mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Merge branch 'PHP-8.5'
* PHP-8.5: Fix GH-20699: SQLite3Result fetchArray return array|false, null returned
This commit is contained in:
@@ -2043,6 +2043,7 @@ PHP_METHOD(SQLite3Result, fetchArray)
|
||||
|
||||
default:
|
||||
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)));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
14
ext/sqlite3/tests/gh20699.phpt
Normal file
14
ext/sqlite3/tests/gh20699.phpt
Normal file
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
GH-20699 (SQLite3Result fetchArray return array|false, null returned)
|
||||
--EXTENSIONS--
|
||||
sqlite3
|
||||
--CREDITS--
|
||||
plusminmax
|
||||
--FILE--
|
||||
<?php
|
||||
$db = new SQLite3(':memory:');
|
||||
var_dump($db->prepare('BEGIN;')->execute()->fetchArray());
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: SQLite3Result::fetchArray(): Unable to execute statement: cannot start a transaction within a transaction in %s on line %d
|
||||
bool(false)
|
||||
Reference in New Issue
Block a user