Edit report at https://bugs.php.net/bug.php?id=66621&edit=1
ID: 66621
Updated by: php-bugs@lists.php.net
Reported by: enrico_kaelert at kabelmail dot de
Summary: PDO::commit() bug
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: PDO MySQL
Operating System: Windows 7 64bit
PHP Version: Irrelevant
Assigned To: ab
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2014-07-14 13:02:24] enrico_kaelert at kabelmail dot de
Any news on this one?
I just tried the same using the msqli object
(http://php.net/manual/de/mysqli.quickstart.prepared-statements.php)
and i found out that its "forbidden" to use multi-queries (getting always an e-code).
And that good! if we use something wrong, slap us with a e-msgs =)
But when you add that to the PDO:: ?
------------------------------------------------------------------------
[2014-04-30 14:28:40] ab@php.net
Enrico,
I meant you stay on windows with PHP, but use mysqld on linux. Not both of them on Linux. But after
what you report it actually smells on some config issue, as on my side it was all fine on linux
(with your last http://pastebin.com/wt2DiNNB).
Thanks.
------------------------------------------------------------------------
[2014-04-30 14:06:16] enrico_kaelert at kabelmail dot de
Debian
MySQL Server Version: 5.5.31-1~dotdeb.0
PHP Version: 5.4.25-1~dotdeb.0
Same result as on windows:
1st $type : no inserts
2nd $type : inserts made
So i cant confirm that this happen only on windows
------------------------------------------------------------------------
[2014-04-30 11:47:58] ab@php.net
Johannes, thanks for looking in. As far as I could debug by now, the behaviour is reproduceable.
But, only if mysqld runs on windows. When I point the snippet from April 24th to a DB running under
Linux, the error disappears. Strange enough, but seems to have to do with mysqld+platform itself or
its configs.
Additionally, as far I could debug, the error is caused by something in mysqlnd, namely
mysqlnd.c:320 in simple_command method. There, when asked for the connection status, it appears to
be CONN_NEXT_RESULT_PENDING, so produces an error and no COMMIT. In the backtrace, simple_method is
called from the pdo commit method doing COMMIT query internally. That's all I have at the
moment, so digging deeper into it. Interestingly, when adding CONN_NEXT_RESULT_PENDING to CONN_READY
case, it seems to pass. But I'm entirely not sure it should be so.
Enrico, could you please test whether it works if you use mysqld not on windows? Thanks.
------------------------------------------------------------------------
[2014-04-29 15:07:30] enrico_kaelert at kabelmail dot de
edit:
try this:
change the query in the test script to:
# 3. multi insert via beginTransaction() and commit() / rollBack()
(...)
$sql = "
-- this is my pretty commented query ...
-- above comments works
INSERT INTO
testdb.tbl
SET
name = 'a' -- middle comment works
-- name = 'a' middle new line comments works
; -- but this comment finally f* it up
-- so simple nothing is allowed after the ;
-- except if we destroy the stmt
";
------------------------------------------------------------------------
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=66621
--
Edit this bug report at https://bugs.php.net/bug.php?id=66621&edit=1