]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4'
authorChristoph M. Becker <cmbecker69@gmx.de>
Fri, 21 Feb 2020 12:38:29 +0000 (13:38 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Fri, 21 Feb 2020 12:39:05 +0000 (13:39 +0100)
* PHP-7.4:
  Fix #79294: ::columnType() may fail after SQLite3Stmt::reset()

1  2 
ext/sqlite3/php_sqlite3_structs.h
ext/sqlite3/sqlite3.c

index d86f39e4310ce343c9b51602533954c89f48262c,3de8aac0d40dbdb10835c176829558db5af97651..80e915da6829c7969f62ada97e46e17bb5cdf8f5
@@@ -108,7 -108,7 +108,6 @@@ struct _php_sqlite3_result_object  
        zval stmt_obj_zval;
  
        int is_prepared_statement;
-       int complete;
 -      int complete; // unused
        zend_object zo;
  };
  
index 812758433dd0a4dc31047fb1b48a959d50c7e4de,3a3ade7bc3951b811ce19e51b8898551fab9292b..0d5fc6de081a54327090169c71de5c3680cb24d1
@@@ -2001,10 -1980,10 +2001,10 @@@ PHP_METHOD(sqlite3result, columnType
        SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
  
        if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &column) == FAILURE) {
 -              return;
 +              RETURN_THROWS();
        }
  
-       if (result_obj->complete) {
+       if (!sqlite3_data_count(result_obj->stmt_obj->stmt)) {
                RETURN_FALSE;
        }