Skip to content

Commit 3de6dd1

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: Squashed commit of the following:
2 parents 1f648c3 + c566502 commit 3de6dd1

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

ext/mysqli/mysqli_nonapi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,7 @@ PHP_FUNCTION(mysqli_begin_transaction)
10291029
}
10301030

10311031
if (FAIL == mysqlnd_begin_transaction(mysql->mysql, flags, name)) {
1032+
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
10321033
RETURN_FALSE;
10331034
}
10341035
RETURN_TRUE;
@@ -1053,6 +1054,7 @@ PHP_FUNCTION(mysqli_savepoint)
10531054
}
10541055

10551056
if (FAIL == mysqlnd_savepoint(mysql->mysql, name)) {
1057+
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
10561058
RETURN_FALSE;
10571059
}
10581060
RETURN_TRUE;
@@ -1076,6 +1078,7 @@ PHP_FUNCTION(mysqli_release_savepoint)
10761078
RETURN_THROWS();
10771079
}
10781080
if (FAIL == mysqlnd_release_savepoint(mysql->mysql, name)) {
1081+
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
10791082
RETURN_FALSE;
10801083
}
10811084
RETURN_TRUE;
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
--TEST--
2+
mysqli_begin_transaction()
3+
--EXTENSIONS--
4+
mysqli
5+
--SKIPIF--
6+
<?php
7+
require_once 'skipifconnectfailure.inc';
8+
9+
require_once 'connect.inc';
10+
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
11+
die(sprintf("skip Cannot connect, [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
12+
13+
if (!have_innodb($link))
14+
die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error));
15+
?>
16+
--FILE--
17+
<?php
18+
require_once 'connect.inc';
19+
20+
mysqli_report(MYSQLI_REPORT_ALL & ~MYSQLI_REPORT_INDEX);
21+
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
22+
try {
23+
mysqli_query($link, sprintf('KILL %d', mysqli_thread_id($link)));
24+
} catch (mysqli_sql_exception) {
25+
// ignore
26+
}
27+
28+
try {
29+
mysqli_begin_transaction($link);
30+
} catch (mysqli_sql_exception $e) {
31+
echo "Expecting an exception.\n";
32+
}
33+
34+
echo "done!\n";
35+
?>
36+
--CLEAN--
37+
<?php
38+
require_once 'clean_table.inc';
39+
?>
40+
--EXPECT--
41+
Expecting an exception.
42+
done!

0 commit comments

Comments
 (0)