scottmac                Tue Jan 20 00:24:14 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/sqlite3        sqlite3.c 
  Log:
  MFH Fix bug #47145 - As soon as sqlite3_step is called on a statement it 
always must be finalised.
  
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/sqlite3.c?r1=1.1.2.26&r2=1.1.2.27&diff_format=u
Index: php-src/ext/sqlite3/sqlite3.c
diff -u php-src/ext/sqlite3/sqlite3.c:1.1.2.26 
php-src/ext/sqlite3/sqlite3.c:1.1.2.27
--- php-src/ext/sqlite3/sqlite3.c:1.1.2.26      Mon Jan 19 22:43:58 2009
+++ php-src/ext/sqlite3/sqlite3.c       Tue Jan 20 00:24:13 2009
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: sqlite3.c,v 1.1.2.26 2009/01/19 22:43:58 scottmac Exp $ */
+/* $Id: sqlite3.c,v 1.1.2.27 2009/01/20 00:24:13 scottmac Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1067,6 +1067,8 @@
        zval *object = getThis();
        int return_code = 0;
        struct php_sqlite3_bound_param *param;
+       php_sqlite3_free_list *free_item;
+
        stmt_obj = (php_sqlite3_stmt *)zend_object_store_get_object(object 
TSRMLS_CC);
 
        if (zend_parse_parameters_none() == FAILURE) {
@@ -1140,13 +1142,16 @@
        }
 
        return_code = sqlite3_step(stmt_obj->stmt);
+       free_item = emalloc(sizeof(php_sqlite3_free_list));
+       free_item->stmt_obj = stmt_obj;
+       free_item->stmt_obj_zval = getThis();
+
+       zend_llist_add_element(&(stmt_obj->db_obj->free_list), &free_item);
 
        switch (return_code) {
                case SQLITE_ROW: /* Valid Row */
                case SQLITE_DONE: /* Valid but no results */
                {
-                       php_sqlite3_free_list *free_item;
-
                        sqlite3_reset(stmt_obj->stmt);
                        object_init_ex(return_value, php_sqlite3_result_entry);
                        result = (php_sqlite3_result 
*)zend_object_store_get_object(return_value TSRMLS_CC);
@@ -1158,12 +1163,6 @@
                        result->stmt_obj = stmt_obj;
                        result->stmt_obj_zval = getThis();
 
-                       free_item = emalloc(sizeof(php_sqlite3_free_list));
-                       free_item->stmt_obj = stmt_obj;
-                       free_item->stmt_obj_zval = getThis();
-
-                       zend_llist_add_element(&(stmt_obj->db_obj->free_list), 
&free_item);
-
                        break;
                }
                case SQLITE_ERROR:



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to