Bug #61613 [Asn->Nab]: No PDO error if first SQL statement of a group is valid.

From: Date: Wed, 16 Sep 2015 10:31:26 +0000
Subject: Bug #61613 [Asn->Nab]: No PDO error if first SQL statement of a group is valid.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196036@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61613&edit=1 ID: 61613 Updated by: tony2001@php.net Reported by: trebitzki at gmx dot net Summary: No PDO error if first SQL statement of a group is valid. -Status: Assigned +Status: Not a bug Type: Bug Package: PDO MySQL Operating System: Mac OS X PHP Version: 5.3.10 Assigned To: mysql Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Since there are two statements and the first one is valid, you have to use nextRowset() and this is expected behavior. Previous Comments: ------------------------------------------------------------------------ [2015-09-16 10:23:42] col dot shrapnel at gmail dot com Come on, close it as bogus already. To get an exception one have to move over resultsets, using nextRowset(), which is the proper way, not a "workaround" as someone called it. ------------------------------------------------------------------------ [2015-08-02 09:19:13] fekiri_malek at hotmail dot com i have the same problem with php 5.5.12 on windows 7 x86 ------------------------------------------------------------------------ [2015-06-16 15:51:21] blaimi at blaimi dot de I'm using this as workaround: $pdo->beginTransaction(); try { $statement = $pdo->prepare($sql); $statement->execute(); while ($statement->nextRowset()) {/* https://bugs.php.net/bug.php?id=61613 */}; $pdo->commit(); } catch (\PDOException $e) { $pdo->rollBack(); throw $e; } ------------------------------------------------------------------------ [2015-04-14 14:12:42] mikhail dot v dot gavrilov at gmail dot com This bug still not fixed in PHP 5.6.7 Linux Fedora 21 ------------------------------------------------------------------------ [2014-10-13 10:26:45] pesterhazy at gmail dot com Though it is possible to run multiple statements using mysqli::multi_query, with PDO it just doesn't work. For example, if you exec() a string containing multiple INSERT statements, only the first statement will be executed. No exception is thrown (PHP 5.5.17, MySQL server 5.5.38). This is a bug. Running multiple SQL statements is useful, among other things, for creating stored procedures. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=61613 -- Edit this bug report at https://bugs.php.net/bug.php?id=61613&edit=1

« previous php.bugs (#196036) next »