Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ext/sqlite3/sqlite3.c
Original file line number Diff line number Diff line change
Expand Up @@ -2011,6 +2011,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;
}
}
/* }}} */
Expand Down
14 changes: 14 additions & 0 deletions ext/sqlite3/tests/gh20699.phpt
Original file line number Diff line number Diff line change
@@ -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)
Loading