]> granicus.if.org Git - php/commitdiff
Fix mysqli_release_savepoint() on mysqlnd
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 17 Sep 2020 13:59:09 +0000 (15:59 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 17 Sep 2020 13:59:09 +0000 (15:59 +0200)
mysqli_release_savepoint() was not actually releasing a savepoint...

ext/mysqli/mysqli_nonapi.c
ext/mysqli/tests/mysqli_release_savepoint.phpt

index 0d4a1704cd06beb5e5c8b96bdc1ebab5df85b51b..3d0240183a8ddb0b547cfa8900523b632892afd8 100644 (file)
@@ -1234,7 +1234,7 @@ PHP_FUNCTION(mysqli_release_savepoint)
 #if !defined(MYSQLI_USE_MYSQLND)
        if (mysqli_savepoint_libmysql(mysql->mysql, name, TRUE)) {
 #else
-       if (FAIL == mysqlnd_savepoint(mysql->mysql, name)) {
+       if (FAIL == mysqlnd_release_savepoint(mysql->mysql, name)) {
 #endif
                RETURN_FALSE;
        }
index e6417288d4d2e510e96362c1f584498d925ef21f..8f395ef6f81e3bba708cab26c7ae6f482dcd5153 100644 (file)
@@ -50,7 +50,7 @@ if (!have_innodb($link))
                printf("[009] Cannot turn off autocommit, expecting true, got %s/%s\n", gettype($tmp), $tmp);
 
        /* note that there is no savepoint my... */
-       if (true !== ($tmp = mysqli_release_savepoint($link, 'my')))
+       if (false !== ($tmp = mysqli_release_savepoint($link, 'my')))
                printf("[010] Got %s - [%d] %s\n", var_dump($tmp, true), mysqli_errno($link), mysqli_error($link));
 
        if (!mysqli_query($link, 'INSERT INTO test(id) VALUES (1)'))