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:9
Avg. Score:4.9 ± 0.3
Reproduced:9 of 9 (100.0%)
Same Version:7 (77.8%)
Same OS:9 (100.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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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 Sep 15 16:01:27 2019 UTC