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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: contact at sshilko dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC