db_query("UPDATE {$table} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", $data, time(), $expire, $headers, $serialized, $cid);

should be:

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("INSERT INTO {$table} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, $data, time(), $expire, $headers, $serialized);

should be:

@db_query("INSERT INTO {{$table}} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, $data, time(), $expire, $headers, $serialized);

Otherwise one cannot prefix the cache tables as you might want. "{$var}" syntax denotes a variable in a string in PHP syntax. There are obviously other ways to write the syntax to make it work like substituting strings, %s.

Comments

robertdouglass’s picture

Good catch. Thanks for reporting. How my eyes tricked me!

robertdouglass’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.