diff -urp memcache/memcache.db.inc memcachenew/memcache.db.inc
--- memcache/memcache.db.inc	2008-01-29 18:43:34.000000000 -0500
+++ memcachenew/memcache.db.inc	2008-07-22 01:28:58.000000000 -0400
@@ -21,7 +21,7 @@ function cache_get($key, $table = 'cache
   $cache_flush = variable_get('cache_flush', 0);
   if ($cache_flush && ($cache_flush + variable_get('cache_lifetime', 0) <= time())) {
     // Time to flush old cache data
-    db_query("DELETE FROM {%s} WHERE expire != %d AND expire <= %d", $table, CACHE_PERMANENT, $cache_flush);
+    db_query("DELETE FROM {". $table ."} WHERE expire != %d AND expire <= %d", CACHE_PERMANENT, $cache_flush);
     variable_set('cache_flush', 0);
   }
 
@@ -31,7 +31,7 @@ function cache_get($key, $table = 'cache
   }
 
   // Look for a database cache hit.
-  if ($cache = db_fetch_object(db_query("SELECT data, created, headers, expire, serialized FROM {%s} WHERE cid = '%s'", $table, $key))) {
+  if ($cache = db_fetch_object(db_query("SELECT data, created, headers, expire, serialized FROM {". $table ."} WHERE cid = '%s'", $key))) {
     if (isset($cache->data)) {
       // If the data is permanent or we're not enforcing a minimum cache lifetime
       // always return the cached data.
@@ -134,7 +134,7 @@ function cache_set($cid, $table = 'cache
     }
     // Save to the database
     db_query("
-       INSERT INTO {$table} (data, created, expire, headers, serialized, cid) VALUES (%b, %d, %d, '%s', %d, '%s') ON DUPLICATE KEY
+       INSERT INTO {". $table ."} (data, created, expire, headers, serialized, cid) VALUES (%b, %d, %d, '%s', %d, '%s') ON DUPLICATE KEY
        UPDATE data = %b, created = %d, expire = %d, headers = '%s', serialized = %d",
        $data, $time, $expire, $headers, $serialized, $cid,
        $data, $time, $expire, $headers, $serialized, $cid);
@@ -209,26 +209,26 @@ function cache_clear_all($cid = NULL, $t
       else if (time() > ($cache_flush + variable_get('cache_lifetime', 0))) {
         // Clear the cache for everyone, cache_flush_delay seconds have
         // passed since the first request to clear the cache.
-        db_query("DELETE FROM {%s} WHERE expire != %d AND expire < %d", $table, CACHE_PERMANENT, time());
+        db_query("DELETE FROM {". $table ."} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
         variable_set('cache_flush', 0);
       }
     }
     else {
       // No minimum cache lifetime, flush all temporary cache entries now.
-      db_query("DELETE FROM {%s} WHERE expire != %d AND expire < %d", $table, CACHE_PERMANENT, time());
+      db_query("DELETE FROM {". $table ."} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
     }
   }
   else {
     if ($wildcard) {
       if ($cid == '*') {
-        db_query("DELETE FROM {%s}", $table);
+        db_query("DELETE FROM {". $table ."}");
       }
       else {
-        db_query("DELETE FROM {%s} WHERE cid LIKE '%s%%'", $table, $cid);
+        db_query("DELETE FROM {". $table ."} WHERE cid LIKE '%s%%'", $cid);
       }
     }
     else {
-      db_query("DELETE FROM {%s} WHERE cid = '%s'", $table, $cid);
+      db_query("DELETE FROM {". $table ."} WHERE cid = '%s'", $cid);
     }
   }
 }
diff -urp memcache/patches/DRUPAL-5-0-cache-serialize.patch memcachenew/patches/DRUPAL-5-0-cache-serialize.patch
--- memcache/patches/DRUPAL-5-0-cache-serialize.patch	2008-01-29 17:50:25.000000000 -0500
+++ memcachenew/patches/DRUPAL-5-0-cache-serialize.patch	2008-07-22 01:30:55.000000000 -0400
@@ -37,7 +37,7 @@ diff -ur includes/cache.inc includes/cac
    }
  
 -  $cache = db_fetch_object(db_query("SELECT data, created, headers, expire FROM {%s} WHERE cid = '%s'", $table, $key));
-+  $cache = db_fetch_object(db_query("SELECT data, created, headers, expire, serialized FROM {%s} WHERE cid = '%s'", $table, $key));
++  $cache = db_fetch_object(db_query("SELECT data, created, headers, expire, serialized FROM {". $table ."} WHERE cid = '%s'", $key));
    if (isset($cache->data)) {
      // If the data is permanent or we're not enforcing a minimum cache lifetime
      // always return the cached data.
@@ -81,10 +81,10 @@ diff -ur includes/cache.inc includes/cac
 +  }
    db_lock_table($table);
 -  db_query("UPDATE {%s} SET data = %b, created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $table, $data, time(), $expire, $headers, $cid);
-+  db_query("UPDATE {$table} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", $data, time(), $expire, $headers, $serialized, $cid);
++  db_query("UPDATE {". $table ."} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", $data, time(), $expire, $headers, $serialized, $cid);
    if (!db_affected_rows()) {
 -    @db_query("INSERT INTO {%s} (cid, data, created, expire, headers) VALUES ('%s', %b, %d, %d, '%s')", $table, $cid, $data, time(), $expire, $headers);
-+    @db_query("INSERT INTO {$table} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, $data, time(), $expire, $headers, $serialized);
++    @db_query("INSERT INTO {". $table ."} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, $data, time(), $expire, $headers, $serialized);
    }
    db_unlock_tables();
  }
diff -urp memcache/patches/DRUPAL-5-1-cache-serialize.patch memcachenew/patches/DRUPAL-5-1-cache-serialize.patch
--- memcache/patches/DRUPAL-5-1-cache-serialize.patch	2008-01-29 17:50:25.000000000 -0500
+++ memcachenew/patches/DRUPAL-5-1-cache-serialize.patch	2008-07-22 01:31:49.000000000 -0400
@@ -37,7 +37,7 @@ diff -ur includes/cache.inc includes/cac
    }
  
 -  $cache = db_fetch_object(db_query("SELECT data, created, headers, expire FROM {%s} WHERE cid = '%s'", $table, $key));
-+  $cache = db_fetch_object(db_query("SELECT data, created, headers, expire, serialized FROM {%s} WHERE cid = '%s'", $table, $key));
++  $cache = db_fetch_object(db_query("SELECT data, created, headers, expire, serialized FROM {". $table ."} WHERE cid = '%s'", $key));
    if (isset($cache->data)) {
      // If the data is permanent or we're not enforcing a minimum cache lifetime
      // always return the cached data.
@@ -81,10 +81,10 @@ diff -ur includes/cache.inc includes/cac
 +  }
    db_lock_table($table);
 -  db_query("UPDATE {%s} SET data = %b, created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $table, $data, time(), $expire, $headers, $cid);
-+  db_query("UPDATE {$table} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", $data, time(), $expire, $headers, $serialized, $cid);
++  db_query("UPDATE {". $table ."} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", $data, time(), $expire, $headers, $serialized, $cid);
    if (!db_affected_rows()) {
 -    @db_query("INSERT INTO {%s} (cid, data, created, expire, headers) VALUES ('%s', %b, %d, %d, '%s')", $table, $cid, $data, time(), $expire, $headers);
-+    @db_query("INSERT INTO {$table} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, $data, time(), $expire, $headers, $serialized);
++    @db_query("INSERT INTO {". $table ."} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, $data, time(), $expire, $headers, $serialized);
    }
    db_unlock_tables();
  }
