I just updated my CVS of Drupal 7 and dumped all the tables in my Drupal 7 database. Copied a new settings.php from the default.settings.php. Then, I went to the drupal7 install.php in firefox 3.0.5. Selected Drupal (minimal) and then inputted my database information. The next loaded page was a page with an error on it:
PDOException: SELECT fid FROM {files} WHERE status & :permanent != :permanent AND timestamp < :timestamp - Array ( [:permanent] => 1 [:timestamp] => 1230720678 ) SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in system_cron() (line 1516 of C:\www\webroot\drupal-7\modules\system\system.module).
The location bar reads: install.php?locale=&profile=expert&op=start&id=1. The first 4 steps of the install system are checked with "Install profile" being the active step. Also, my Drupal 7 database was still filled with 46 tables.
Here are the versions I am running:
Windows XP
Apache 2.2.4
MySQL 5.0.37
PHP 5.2.1
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | file_352956.patch | 1.57 KB | drewish |
| #13 | 352956-the-tale-of-two-placeholders.patch | 1.15 KB | josh waihi |
| #5 | 352956-the-tale-of-two-placeholders.patch | 1.15 KB | damien tournoud |
| #3 | 352956-two-placeholders.patch | 0 bytes | damien tournoud |
Comments
Comment #2
dave reidCan you update to latest HEAD and check to see if this still happens? For reference, the last change to that code was in #330633: Temporary file cleanup needs some love (UnitTest included!) and #353207: Remove FILE_STATUS_TEMPORARY.
Comment #3
damien tournoud commentedThe error is trying to use two times the same placeholder. This is unsupported, even if it works on some PHP/MySQL configurations. This breaks badly on PostgreSQL, too.
Comment #4
drewish commentedI've been running the code on pgsql and not having this problem...
but there's no patch attached.
Comment #5
damien tournoud commentedPfff. Again this 0 length patch...
Comment #6
damien tournoud commentedComment #7
drewish commentedOn IRC DamZ pointed me towards http://bugs.php.net/bug.php?id=40417 and it looks like the bug is specific to PHP 5.2.1.
Comment #8
drewish commentedcrossposted... i'm of the opinion that this is valid code that was broken by a buggy version of PHP.
Comment #9
berdirI am having this bug with PostgreSQL and PHP 5.2.6-2ubuntu4 (patched version from Ubuntu Intrepid). The patch in #5 does fix it but has a slight offset.
Comment #10
damien tournoud commentedWell, ok, having read the arguments in http://bugs.php.net/bug.php?id=40417, I agree that using a placeholder twice should be valid. But... it obviously doesn't work on PostgreSQL on 5.2.6... so we will have to fix this one way or the other.
By the way, I tested this with the suggested change in #354139: Determine if we should use PDO::ATTR_EMULATE_PREPARES on PostgreSQL, without any luck. So this is not specific to the use of PostgreSQL C API.
Comment #11
josh waihi commentedtested #5 - once patched applied, install is fine. I agree with Damien, there isn't much we can do other than work with the bug which should be fine.
Comment #12
dries commentedCan we use :permanent1 and :permanent2? That should be more consistent with the rest of core. Thanks!
Comment #13
josh waihi commentedchanges made per Dries request
Comment #14
drewish commented#341910: file_space_used() not checking properly checking bitmapped status value (adds unit tests) is going to have the same problem.
Comment #15
drewish commentedI added a comment explaining this so someone doesn't try to optimize it out in the future... or at least knows what to test before doing so.
Comment #16
webchickI'm not able to reproduce this on my version of PHP, but enough people have tried it and reported positive consequences, and Dries's concerns are addressed, AND it has a nice comment to explain the obvious "WTF?" someone would have reading this code.
Committed to HEAD. Thanks!