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

Comments

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

Can 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.

damien tournoud’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new0 bytes

The 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.

drewish’s picture

Status: Needs review » Needs work

I've been running the code on pgsql and not having this problem...

but there's no patch attached.

damien tournoud’s picture

StatusFileSize
new1.15 KB

Pfff. Again this 0 length patch...

damien tournoud’s picture

Status: Needs work » Needs review
drewish’s picture

Status: Needs review » Needs work

On 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.

drewish’s picture

Status: Needs work » Needs review

crossposted... i'm of the opinion that this is valid code that was broken by a buggy version of PHP.

berdir’s picture

I 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.

damien tournoud’s picture

Well, 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.

josh waihi’s picture

Status: Needs review » Reviewed & tested by the community

tested #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.

dries’s picture

Status: Reviewed & tested by the community » Needs work

Can we use :permanent1 and :permanent2? That should be more consistent with the rest of core. Thanks!

josh waihi’s picture

Status: Needs work » Needs review
StatusFileSize
new1.15 KB

changes made per Dries request

drewish’s picture

drewish’s picture

StatusFileSize
new1.57 KB

I 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.

webchick’s picture

Status: Needs review » Fixed
Issue tags: +PostgreSQL

I'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!

Status: Fixed » Closed (fixed)
Issue tags: -PostgreSQL

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