Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46748 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9107 invoked from network); 16 Jan 2010 02:00:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jan 2010 02:00:29 -0000 Received: from [127.0.0.1] ([127.0.0.1:7843]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id FD/1B-37310-CBD115B4 for ; Fri, 15 Jan 2010 21:00:28 -0500 Authentication-Results: pb1.pair.com header.from=matt@mattread.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=matt@mattread.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain mattread.com designates 74.125.92.24 as permitted sender) X-PHP-List-Original-Sender: matt@mattread.com X-Host-Fingerprint: 74.125.92.24 qw-out-2122.google.com Received: from [74.125.92.24] ([74.125.92.24:13516] helo=qw-out-2122.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 48/1B-37310-87C115B4 for ; Fri, 15 Jan 2010 20:55:04 -0500 Received: by qw-out-2122.google.com with SMTP id 3so311454qwe.59 for ; Fri, 15 Jan 2010 17:55:01 -0800 (PST) Received: by 10.229.20.77 with SMTP id e13mr2413779qcb.14.1263606901021; Fri, 15 Jan 2010 17:55:01 -0800 (PST) Received: from ?192.168.0.20? ([204.237.33.212]) by mx.google.com with ESMTPS id 20sm2220792qyk.1.2010.01.15.17.54.59 (version=SSLv3 cipher=RC4-MD5); Fri, 15 Jan 2010 17:55:00 -0800 (PST) To: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Date: Fri, 15 Jan 2010 20:54:57 -0500 Message-ID: <1263606897.3850.27.camel@elisa> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Subject: PDO Bug introduced in revision 290786 and released in 5.2.12 and 5.3.1 From: matt@mattread.com (Matt Read) We are developers from the Habari Project, an open source PHP blogging application; We would like to raise concern with a recent change to the logic of PDO. We believe that PHP's revision 290786 [1] should not have been committed (see bug 49521 [2]). This changed the behaviour of PDO so that an object's constructor is called before the properties from the database fields are set. The behaviour requested in bug 49521 [2] was possible already with PDO_FETCH_PROPS_LATE, and indeed this commit renders that flag completely useless. You should also note that this flag is still checked, for no apparent reason, in the code. Several PHP tickets about the same issue have been closed as bogus before this one was committed. See 43717 [3] and 37134 [4], especially the closing comment on the latter, "This is expected, to allow people to access the data from the query within the [constructor] ..." Unfortunately this commit has now made into two releases, 5.2.12 and 5.3.1, and has broken our software. We relied on the behaviour (the expected behaviour) to have properties set (using magic __set) before the constructor was called, to determine what data came from the DB, and what data has been updated since. Revision 290786 seems to have been committed with insufficient thought put in to what was being done, especially given that it was committed only 4 days before release. Now we don't have a choice in how PDO constructs objects, as we did before with the FETCH_PROPS_LATE flag. There were even tests checking that the constructor was called last, the tests were changed rather than questioning whether the existing behaviour was correct. Not to mention a significant behavioural change to PDO being pushed into a minor release, again, 4 days before release. Part of the problem is that it doesn't seem well documented (if at all) that setting the properties before calling the constructor is the intended and correct behaviour. Or rather, was. [1] http://svn.php.net/viewvc/?view=revision&revision=290786 [2] http://bugs.php.net/bug.php?id=49521 [3] http://bugs.php.net/bug.php?id=43717 [4] http://bugs.php.net/bug.php?id=37134 Thanks kindly, Matt Read Michael Harris Richard Cockrum Luke Giuliani