I run Uniform Server 3.3 which is a little outdated but I face a strange (IMO) PHP bug.
Apache/2.0.55 (Win32) DAV/2 PHP/5.1.1
I defined a prefix for tables: "d_"

db_prefix_tables works fine except for the "cache" table. This query: db_query("SELECT data, created, headers, expire, serialized FROM {$table} WHERE cid = '%s'", $key) doesn't prefix "cache" table which gives an error while executing it.

I made a little patch to correct this behaviour, it works fine for me.

To reproduce it, you can download Uniform Server (which is a standalone, portable AMP), checkout the latest drupal HEAD, install it defining a prefix for your tables.
It will install fine and run an error while displyaing the home page.

CommentFileSizeAuthor
cache.inc__0.patch3.29 KBtostinni

Comments

ChrisKennedy’s picture

Hmmm, cache table prefixing was supposedly fixed by http://drupal.org/node/126867

RobRoy’s picture

Haven't tested this, but PHP is probably taking "{$table}" and changing it to "foo" since it thinks the curly braces apply to that variable.

tostinni’s picture

I think RobRoy is right, {$table} get evaluated. There's a lot of comment on php doc regarding curly braces and variables, see http://www.php.net/manual/en/language.variables.php
Should I reopen the issue #126867 and mark this one as duplicate ?

RobRoy’s picture

Yes, reopen that issue and dupe this one please. Good catch.

tostinni’s picture

Status: Needs review » Closed (duplicate)