Problem/Motivation
In the method getMultiple
, includes/cache.inc
there is no guard clause for check if $cids
is empty.
Some contrib modules doesn't validate if are requesting cache from empty items.
What is the real problem? For empty cids, Drupal will execute this query:SELECT cid, data, created, expire, serialized FROM cache WHERE cid IN ()
This will throw an exception, but in database:SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
Proposed resolution
I've attached a patch, but just for cache.inc. Imho, we should review to apply that to every getMultiple method.