|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-06-16 14:44 UTC] scottmac@php.net
[2009-06-17 06:56 UTC] karsten at typo3 dot org
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 20:00:01 2025 UTC |
Description: ------------ After updating to 5.3.0RC3 two unit tests started to fail which worked before. The same tests continue to succeed on MySQL and PostgreSQL, the failure only occurs with SQLite. Reproduce code: --------------- <?php /* -- put this in test.db: CREATE TABLE "referenceproperties" ( "parent" VARCHAR(36) NOT NULL, "name" TEXT NOT NULL, "namespace" TEXT NOT NULL DEFAULT '', "index" INTEGER NOT NULL DEFAULT 0, "value" VARCHAR(36) NOT NULL, PRIMARY KEY ("parent", "name", "namespace", "index") ); CREATE TABLE "properties" ( "parent" VARCHAR(36) NOT NULL, "name" TEXT NOT NULL, "namespace" TEXT NOT NULL DEFAULT '', "multivalue" BOOLEAN NOT NULL DEFAULT '0', "type" INTEGER NOT NULL DEFAULT 0, PRIMARY KEY ("parent", "name", "namespace") ); */ $sql = 'SELECT "properties"."parent" FROM (SELECT DISTINCT "parent" FROM "referenceproperties") AS "pv" JOIN "properties" USING ("parent")'; $databaseHandle = new \PDO('sqlite:test.db'); $databaseHandle->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $databaseHandle->prepare($sql); ?> Expected result: ---------------- simply nothing Actual result: -------------- [note the doubled exception - wtf?] kmac:~ karsten$ php test.php PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1 cannot join using column parent - column not present in both tables' in /Users/karsten/test.php:6 Stack trace: #0 /Users/karsten/test.php(6): PDO->prepare('SELECT "propert...') #1 {main} thrown in /Users/karsten/test.php on line 6 Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1 cannot join using column parent - column not present in both tables' in /Users/karsten/test.php:6 Stack trace: #0 /Users/karsten/test.php(6): PDO->prepare('SELECT "propert...') #1 {main} thrown in /Users/karsten/test.php on line 6