Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 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
13 changes: 13 additions & 0 deletions ext/sqlite3/tests/gh20699.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--TEST--
GH-20699 (SQLite3Result fetchArray return array|false, null returned)
--EXTENSIONS--
sqlite3
--CREDITS--
plusminmax
--FILE--
<?php
$db = new SQLite3(':memory:');
$db->prepare('BEGIN;')->execute()->fetchArray();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might want to print it.

?>
--EXPECTF--
Warning: SQLite3Result::fetchArray(): Unable to execute statement: cannot start a transaction within a transaction in %s on line %d
Loading