#344088 by Damien Tournoud: cache.inc was not fully converted to the new database API.

From: Damien Tournoud <damien@tournoud.net>


---

 includes/cache.inc |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)


diff --git includes/cache.inc includes/cache.inc
index 108bd2a..87e6f35 100644
--- includes/cache.inc
+++ includes/cache.inc
@@ -29,7 +29,17 @@ function cache_get($cid, $table = 'cache') {
       ->execute();
   }
 
-  $cache = db_query("SELECT data, created, headers, expire, serialized FROM {" . $table . "} WHERE cid = :cid", array(':cid' => $cid))->fetchObject();
+  $cache_query = db_select($table)
+    ->fields($table, array(
+      'data',
+      'create',
+      'headers',
+      'expire',
+      'serialized',
+    ))
+    ->condition('cid', $cid)
+    ->execute()
+    ->fetchObject();
   if (isset($cache->data)) {
     // If the data is permanent or we're not enforcing a minimum cache lifetime
     // always return the cached data.
