1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.5'

* PHP-8.5:
  Squashed commit of the following:
This commit is contained in:
Kamil Tekiela
2025-12-14 15:29:58 +00:00
2 changed files with 45 additions and 0 deletions

View File

@@ -1029,6 +1029,7 @@ PHP_FUNCTION(mysqli_begin_transaction)
}
if (FAIL == mysqlnd_begin_transaction(mysql->mysql, flags, name)) {
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1053,6 +1054,7 @@ PHP_FUNCTION(mysqli_savepoint)
}
if (FAIL == mysqlnd_savepoint(mysql->mysql, name)) {
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1076,6 +1078,7 @@ PHP_FUNCTION(mysqli_release_savepoint)
RETURN_THROWS();
}
if (FAIL == mysqlnd_release_savepoint(mysql->mysql, name)) {
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
RETURN_FALSE;
}
RETURN_TRUE;

View File

@@ -0,0 +1,42 @@
--TEST--
mysqli_begin_transaction()
--EXTENSIONS--
mysqli
--SKIPIF--
<?php
require_once 'skipifconnectfailure.inc';
require_once 'connect.inc';
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
die(sprintf("skip Cannot connect, [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
if (!have_innodb($link))
die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error));
?>
--FILE--
<?php
require_once 'connect.inc';
mysqli_report(MYSQLI_REPORT_ALL & ~MYSQLI_REPORT_INDEX);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
try {
mysqli_query($link, sprintf('KILL %d', mysqli_thread_id($link)));
} catch (mysqli_sql_exception) {
// ignore
}
try {
mysqli_begin_transaction($link);
} catch (mysqli_sql_exception $e) {
echo "Expecting an exception.\n";
}
echo "done!\n";
?>
--CLEAN--
<?php
require_once 'clean_table.inc';
?>
--EXPECT--
Expecting an exception.
done!