Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60933 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27802 invoked from network); 22 Jun 2012 02:35:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jun 2012 02:35:16 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qc0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:64489] helo=mail-qc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 99/06-21324-2E9D3EF4 for ; Thu, 21 Jun 2012 22:35:15 -0400 Received: by qcmt36 with SMTP id t36so820916qcm.29 for ; Thu, 21 Jun 2012 19:35:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=ALITWE4t6rvEuhSuMY+4vGVEeo35vPBVtJKTcxBvL0Q=; b=HIVM4OtefZtGwuPRLNr7GyPGLtrt1Q8MdnZkUHb2ufF9rzM4eGEdbeTARsQOKELtTT A9paU9V/MGsH64yCadNZ+oM5Q7YGRnf21mr7BaQEQqBu+YFfq8/C9O9Xrvku++T295V0 QriDPVZwLJt32qCYPZooWaG2KPECNYownk6LUlK8GgDTLMfaAgVoKJEOhgAPa0iGImRw TD3LMivwNcYzxfp+aRUzz2/Yvxvn8bCpDKXshy3r1xNFPflJEI9TFEuay0VlRm4L+0en 8A0I8cQU512Kj9Xcxy/LZMBng3TmsDOS4Z8sgD97+mrombEmIQLGg53YWOn33F10n+tS L61A== MIME-Version: 1.0 Received: by 10.224.78.195 with SMTP id m3mr3701310qak.1.1340332512215; Thu, 21 Jun 2012 19:35:12 -0700 (PDT) Received: by 10.229.232.11 with HTTP; Thu, 21 Jun 2012 19:35:11 -0700 (PDT) In-Reply-To: References: <4FDB5604.5000704@oracle.com> <4FDB62C2.6090702@oracle.com> <4FDC3396.10406@phpdoc.de> <4FE0F301.70808@oracle.com> <4FE2C5D7.2040606@phpdoc.de> Date: Thu, 21 Jun 2012 22:35:11 -0400 Message-ID: To: Ulf Wendel Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [PATCH - PR] Disable ATTR_EMULATE_PREPARES by default for PDO_Mysql From: ircmaxell@gmail.com (Anthony Ferrara) Actually, the more I think about it, this would result in an inadvertent API change. Right now, if you have a SQL syntax error, the error would be thrown by ->execute(). But with this change, the error would be thrown by ->prepare(). So code that currently wraps execute() but not prepare() with a try{}catch(){} would start failing. Is this a show stopper? Or is restoring the "proper" execution path worth i= t? From what I can see in the few open source drivers I looked at, it won't be an issue (Drupal, Doctrine, Zend, Lithium, etc)... Thanks, Anthony On Thu, Jun 21, 2012 at 10:19 PM, Anthony Ferrara wro= te: > As it turns out, the testing of this is far more difficult than I > originally suspected. Not because it fails, but because emulated > queries were behaving badly to begin with, so a number of tests were > testing bad behavior. For example, bug 44327: > > https://github.com/ircmaxell/php-src/blob/master/ext/pdo_mysql/tests/bug4= 4327.phpt > > It runs the following code: > > =A0 =A0 =A0 =A0$stmt =3D $db->prepare('foo'); > =A0 =A0 =A0 =A0@$stmt->execute(); > =A0 =A0 =A0 =A0$row =3D $stmt->fetch(); > =A0 =A0 =A0 =A0var_dump($row->queryString); > > And expects: > > Notice: Trying to get property of non-object in %s on line %d > NULL > > Whereas the proper behavior is for the syntax error to be thrown from > `prepare`. PDO emulation doesn't do that, because it doesn't parse > until `execute`, hence the error delays until that point. > > When I run it, I get: > > Warning: PDO::prepare(): SQLSTATE[42000]: Syntax error or access > violation: 1064 You have an error in your SQL syntax; check the manual > that corresponds to your MySQL server version for the right syntax to > use near 'foo' at line 1 in %s on line %d > > Because it's sent back at prepare() instead of at execute (and prepare > doesn't have an @). > > There are at least a few more failures of this nature. > > To fix this, is going to take some significant refactoring of a number > of tests. Plus, without this patch, I'm still getting 2 warnings and 6 > failures: > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Number of tests : =A0166 =A0 =A0 =A0 =A0 =A0 =A0 =A0 157 > Tests skipped =A0 : =A0 =A09 ( =A05.4%) -------- > Tests warned =A0 =A0: =A0 =A02 ( =A01.2%) ( =A01.3%) > Tests failed =A0 =A0: =A0 =A06 ( =A03.6%) ( =A03.8%) > Expected fail =A0 : =A0 =A01 ( =A00.6%) ( =A00.6%) > Tests passed =A0 =A0: =A0148 ( 89.2%) ( 94.3%) > --------------------------------------------------------------------- > Time taken =A0 =A0 =A0: =A0 43 seconds > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > EXPECTED FAILED TEST SUMMARY > --------------------------------------------------------------------- > PECL Bug #7976 (Calling stored procedure several times) > [ext/pdo_mysql/tests/bug_pecl_7976.phpt] =A0XFAIL REASON: Works with > mysqlnd. It is not supported by libmysql. For libmysql is good enough > to see no crash. > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > FAILED TEST SUMMARY > --------------------------------------------------------------------- > Bug #39858 (Lost connection to MySQL server during query by a repeated > call stored proced) [ext/pdo_mysql/tests/bug_39858.phpt] > PDO MySQL Bug #41997 (stored procedure call returning single rowset > blocks future queries) [ext/pdo_mysql/tests/bug_41997.phpt] > MySQL PDO->__construct() - Generic + DSN > [ext/pdo_mysql/tests/pdo_mysql___construct.phpt] > MySQL PDO->exec(), affected rows > [ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt] > MySQL PDOStatement->nextRowSet() > [ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt] > MySQL Prepared Statements and different column counts > [ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt] > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > WARNED TEST SUMMARY > --------------------------------------------------------------------- > Bug #44454 (Unexpected exception thrown in foreach() statement) > [ext/pdo_mysql/tests/bug_44454.phpt] (warn: XFAIL section but test > passes) > MySQL PDO->prepare(), emulated PS > [ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt] (warn: XFAIL > section but test passes) > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Whereas with the patch, there are a few more failures: > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Number of tests : =A0166 =A0 =A0 =A0 =A0 =A0 =A0 =A0 157 > Tests skipped =A0 : =A0 =A09 ( =A05.4%) -------- > Tests warned =A0 =A0: =A0 =A02 ( =A01.2%) ( =A01.3%) > Tests failed =A0 =A0: =A0 18 ( 10.8%) ( 11.5%) > Expected fail =A0 : =A0 =A01 ( =A00.6%) ( =A00.6%) > Tests passed =A0 =A0: =A0136 ( 81.9%) ( 86.6%) > --------------------------------------------------------------------- > Time taken =A0 =A0 =A0: =A0 53 seconds > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > So to do this, I'd need to fix those as well... (at least all but the XFA= IL) > > So I'm going to keep at it, but it's going to take a while (and would > like some insight into if this is the best approach to fixing the > tests)... > > Thanks, > > Anthony > > On Thu, Jun 21, 2012 at 2:57 AM, Ulf Wendel wrote: >> Am 20.06.2012 08:39, schrieb Pierre Joye: >> >>> hi Chris, >>> >>> On Tue, Jun 19, 2012 at 11:45 PM, Christopher Jones >>> =A0wrote: >>> >>>> We should take this offline - I can see cases where I'd strongly >>>> disagree. >>> >>> >>> I see no reason to move a discussion offline or off list, this is a >>> topic that interests many other readers or developers. >> >> >> Agreed. There was enough trouble around PDO and discussions going on in = the >> hidden. >> >> However, this does not impact the original topic. >> >> Ulf >> >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >>