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.
| Comment | File | Size | Author |
|---|---|---|---|
| cache.inc__0.patch | 3.29 KB | tostinni |
Comments
Comment #1
ChrisKennedy commentedHmmm, cache table prefixing was supposedly fixed by http://drupal.org/node/126867
Comment #2
RobRoy commentedHaven't tested this, but PHP is probably taking "{$table}" and changing it to "foo" since it thinks the curly braces apply to that variable.
Comment #3
tostinni commentedI 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 ?
Comment #4
RobRoy commentedYes, reopen that issue and dupe this one please. Good catch.
Comment #5
tostinni commentedDuplicate of http://drupal.org/node/126867