Skip to content

Commit 727ebfc

Browse files
committed
Avoid query rerun. Partial fix: #13587
1 parent f91dcad commit 727ebfc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/sqlite3/sqlite3.c

+4
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,10 @@ PHP_METHOD(SQLite3, query)
595595
result->column_count = -1;
596596
ZVAL_OBJ(&result->stmt_obj_zval, Z_OBJ(stmt));
597597

598+
if (sqlite3_column_count(result_obj->stmt_obj->stmt) == 0) {
599+
return;
600+
}
601+
598602
return_code = sqlite3_step(result->stmt_obj->stmt);
599603

600604
switch (return_code) {

0 commit comments

Comments
 (0)