cvs: php-src /ext/sqlite sqlite.c

From: Date: Sat, 08 Mar 2008 04:17:30 +0000
Subject: cvs: php-src /ext/sqlite sqlite.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-48951@lists.php.net to get a copy of this message
scottmac Sat Mar 8 04:17:30 2008 UTC Modified files: /php-src/ext/sqlite sqlite.c Log: Fixed bug #42203 (Clear SQLite result sets before closing database.) http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/sqlite.c?r1=1.206&r2=1.207&diff_format=u Index: php-src/ext/sqlite/sqlite.c diff -u php-src/ext/sqlite/sqlite.c:1.206 php-src/ext/sqlite/sqlite.c:1.207 --- php-src/ext/sqlite/sqlite.c:1.206 Thu Feb 28 14:16:14 2008 +++ php-src/ext/sqlite/sqlite.c Sat Mar 8 04:17:30 2008 @@ -17,7 +17,7 @@ | Marcus Boerger <helly@php.net> | +----------------------------------------------------------------------+ - $Id: sqlite.c,v 1.206 2008/02/28 14:16:14 felipe Exp $ + $Id: sqlite.c,v 1.207 2008/03/08 04:17:30 scottmac Exp $ */ #ifdef HAVE_CONFIG_H @@ -449,6 +449,17 @@ efree(res); } +static int _clean_unfinished_results(zend_rsrc_list_entry *le, void *db TSRMLS_DC) +{ + if (Z_TYPE_P(le) == le_sqlite_result) { + struct php_sqlite_result *res = (struct php_sqlite_result *)le->ptr; + if (res->db->rsrc_id == ((struct php_sqlite_db*)db)->rsrc_id) { + real_result_dtor(res TSRMLS_CC); + } + } + return 0; +} + static ZEND_RSRC_DTOR_FUNC(php_sqlite_result_dtor) { struct php_sqlite_result *res = (struct php_sqlite_result *)rsrc->ptr; @@ -1220,7 +1231,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "SQLite support", "enabled"); - php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.206 2008/02/28 14:16:14 felipe Exp $"); + php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.207 2008/03/08 04:17:30 scottmac Exp $"); php_info_print_table_row(2, "SQLite Library", sqlite_libversion()); php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding()); php_info_print_table_end(); @@ -1515,6 +1526,10 @@ DB_FROM_ZVAL(db, &zdb); } + zend_hash_apply_with_argument(&EG(regular_list), + (apply_func_arg_t) _clean_unfinished_results, + db TSRMLS_CC); + zend_list_delete(Z_RESVAL_P(zdb)); } /* }}} */

« previous php.cvs (#48951) next »