php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch fix64531-sqlite3-fetchArray-skipNoColumns for SQLite related Bug #64531

Patch version 2020-02-01 00:13 UTC

Return to Bug #64531 | Download this patch
Patch Revisions:

Developer: antoni@friki.cat

--- php-7.4.2/ext/sqlite3/sqlite3.c	2020-01-21 12:35:21.000000000 +0100
+++ php-7.4.2-sqlite3fixed2/ext/sqlite3/sqlite3.c	2020-01-31 23:37:17.449123405 +0100
@@ -2007,6 +2007,10 @@ PHP_METHOD(sqlite3result, fetchArray)
 		return;
 	}
 
+	if (sqlite3_column_count(result_obj->stmt_obj->stmt) == 0) {
+                return;
+        }
+
 	ret = sqlite3_step(result_obj->stmt_obj->stmt);
 	switch (ret) {
 		case SQLITE_ROW:
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 07:01:28 2024 UTC