php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69656 mysqli_commit does not commits with MYSQLI_ASYNC, mysqli_kill returns false
Submitted: 2015-05-18 16:02 UTC Modified: 2015-05-19 13:38 UTC
Votes:10
Avg. Score:4.9 ± 0.3
Reproduced:10 of 10 (100.0%)
Same Version:7 (70.0%)
Same OS:9 (90.0%)
From: contact at sshilko dot com Assigned:
Status: Open Package: MySQLi related
PHP Version: 5.5.24 OS: Ubuntu 12.04.5 LTS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
42 - 5 = ?
Subscribe to this entry?

 
 [2015-05-18 16:02 UTC] contact at sshilko dot com
Description:
------------
mysqli_commit does not work when using mysqlnd + MYSQLI_ASYNC + autocommit=false.

The main transaction gets commited, but everything executed via MYSQLI_ASYNC does not get commited.

Test script:
---------------
https://gist.github.com/sshilko/2119c6b87ff4887142ab

Expected result:
----------------
$ time php async.php 
Doing insert AUTOCOMMIT=FALSE: 
INSERT INTO asynctest (`date`, `user_id`) values ('2015-05-18', '1431964720')
Insert done
Doing select: 
Array
(
    [0] => Array
        (
            [COUNT(*)] => 1
        )

)
Doing insert AUTOCOMMIT=TRUE: 
INSERT INTO asynctest (`date`, `user_id`) values ('2015-05-18', '1431964720')
Insert done
Doing select: 
Array
(
    [0] => Array
        (
            [COUNT(*)] => 2
        )

)

real    0m0.032s
user    0m0.013s
sys     0m0.003s


Actual result:
--------------
$ time php async.php 
Doing insert AUTOCOMMIT=FALSE: 
INSERT INTO asynctest (`date`, `user_id`) values ('2015-05-18', '1431964720')
Insert done
Doing select: 
Array
(
    [0] => Array
        (
            [COUNT(*)] => 0
        )

)
Doing insert AUTOCOMMIT=TRUE: 
INSERT INTO asynctest (`date`, `user_id`) values ('2015-05-18', '1431964720')
Insert done
Doing select: 
Array
(
    [0] => Array
        (
            [COUNT(*)] => 1
        )

)

real    0m0.032s
user    0m0.013s
sys     0m0.003s


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-05-19 13:38 UTC] contact at sshilko dot com
-Summary: mysqli_commit does not affect MYSQLI_ASYNC +Summary: mysqli_commit does not commits with MYSQLI_ASYNC, mysqli_kill returns false -Operating System: Linux +Operating System: Ubuntu 12.04.5 LTS -PHP Version: 5.5.25 +PHP Version: 5.5.24
 [2015-05-19 13:38 UTC] contact at sshilko dot com
One more observation: mysqli_kill() returns FALSE after MYSQLI_ASYNC query, whether same code w/o MYSQLI_ASYNC returns TRUE
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 03:01:23 2019 UTC