mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: Squashed commit of the following:
This commit is contained in:
3
NEWS
3
NEWS
@@ -60,6 +60,9 @@ PHP NEWS
|
||||
. Fix some deprecations on newer libxml versions regarding input
|
||||
buffer/parser handling. (ndossche)
|
||||
|
||||
- mysqli:
|
||||
. Make mysqli_begin_transaction() report errors properly. (Kamil Tekiela)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug GH-20528 (Regression breaks mysql connexion using an IPv6 address
|
||||
enclosed in square brackets). (Remi)
|
||||
|
||||
@@ -1031,6 +1031,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;
|
||||
@@ -1055,6 +1056,7 @@ PHP_FUNCTION(mysqli_savepoint)
|
||||
}
|
||||
|
||||
if (FAIL == mysqlnd_savepoint(mysql->mysql, name)) {
|
||||
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_TRUE;
|
||||
@@ -1078,6 +1080,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;
|
||||
|
||||
42
ext/mysqli/tests/mysqli_begin_transaction_error.phpt
Normal file
42
ext/mysqli/tests/mysqli_begin_transaction_error.phpt
Normal 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!
|
||||
Reference in New Issue
Block a user