Skip to content

Commit 0ef52c3

Browse files
committed
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: Fix GH-20699: SQLite3Result fetchArray return array|false, null returned
2 parents c566502 + f3d5dd0 commit 0ef52c3

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ PHP NEWS
1717
. Fixed bug GH-20668 (\Uri\WhatWg\Url::withHost() crashes (SEGV) for URLs
1818
using the file: scheme). (lexborisov)
1919

20+
- Sqlite3:
21+
. Fixed bug GH-20699 (SQLite3Result fetchArray return array|false,
22+
null returned). (ndossche, plusminmax)
23+
2024
- Standard:
2125
. Fix error check for proc_open() command. (ndossche)
2226

ext/sqlite3/sqlite3.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,6 +2044,7 @@ PHP_METHOD(SQLite3Result, fetchArray)
20442044

20452045
default:
20462046
php_sqlite3_error(result_obj->db_obj, sqlite3_errcode(sqlite3_db_handle(result_obj->stmt_obj->stmt)), "Unable to execute statement: %s", sqlite3_errmsg(sqlite3_db_handle(result_obj->stmt_obj->stmt)));
2047+
RETURN_FALSE;
20472048
}
20482049
}
20492050
/* }}} */

ext/sqlite3/tests/gh20699.phpt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
GH-20699 (SQLite3Result fetchArray return array|false, null returned)
3+
--EXTENSIONS--
4+
sqlite3
5+
--CREDITS--
6+
plusminmax
7+
--FILE--
8+
<?php
9+
$db = new SQLite3(':memory:');
10+
var_dump($db->prepare('BEGIN;')->execute()->fetchArray());
11+
?>
12+
--EXPECTF--
13+
Warning: SQLite3Result::fetchArray(): Unable to execute statement: cannot start a transaction within a transaction in %s on line %d
14+
bool(false)

0 commit comments

Comments
 (0)