Skip to content

Commit c54abaa

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Squashed commit of the following:
2 parents 9047524 + dbf56e0 commit c54abaa

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

NEWS

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PHP NEWS
88

99
- Bz2:
1010
. Fixed bug GH-20620 (bzcompress overflow on large source size).
11-
(David Carlier)
11+
(David Carlier)
1212

1313
- GD:
1414
. Fixed bug GH-20622 (imagestring/imagestringup overflow). (David Carlier)
@@ -22,7 +22,7 @@ PHP NEWS
2222

2323
- Standard:
2424
. Fix error check for proc_open() command. (ndossche)
25-
25+
2626
18 Dec 2025, PHP 8.4.16
2727

2828
- Core:
@@ -74,6 +74,9 @@ PHP NEWS
7474
. Fixed bug GH-20492 (mbstring compile warning due to non-strings).
7575
(ndossche)
7676

77+
- mysqli:
78+
. Make mysqli_begin_transaction() report errors properly. (Kamil Tekiela)
79+
7780
- MySQLnd:
7881
. Fixed bug GH-20528 (Regression breaks mysql connexion using an IPv6 address
7982
enclosed in square brackets). (Remi)

ext/mysqli/mysqli_nonapi.c

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

10201020
if (FAIL == mysqlnd_begin_transaction(mysql->mysql, flags, name)) {
1021+
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
10211022
RETURN_FALSE;
10221023
}
10231024
RETURN_TRUE;
@@ -1042,6 +1043,7 @@ PHP_FUNCTION(mysqli_savepoint)
10421043
}
10431044

10441045
if (FAIL == mysqlnd_savepoint(mysql->mysql, name)) {
1046+
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
10451047
RETURN_FALSE;
10461048
}
10471049
RETURN_TRUE;
@@ -1065,6 +1067,7 @@ PHP_FUNCTION(mysqli_release_savepoint)
10651067
RETURN_THROWS();
10661068
}
10671069
if (FAIL == mysqlnd_release_savepoint(mysql->mysql, name)) {
1070+
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
10681071
RETURN_FALSE;
10691072
}
10701073
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)