scottmac Sat Nov 22 11:48:42 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/sqlite sqlite.c
Log:
MFH Error handler isn't properly restored when using fetchObject() with SQLite
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/sqlite.c?r1=1.166.2.13.2.9.2.16&r2=1.166.2.13.2.9.2.17&diff_format=u
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.166.2.13.2.9.2.16
php-src/ext/sqlite/sqlite.c:1.166.2.13.2.9.2.17
--- php-src/ext/sqlite/sqlite.c:1.166.2.13.2.9.2.16 Wed Nov 19 02:00:53 2008
+++ php-src/ext/sqlite/sqlite.c Sat Nov 22 11:48:42 2008
@@ -17,7 +17,7 @@
| Marcus Boerger <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
- $Id: sqlite.c,v 1.166.2.13.2.9.2.16 2008/11/19 02:00:53 colder Exp $
+ $Id: sqlite.c,v 1.166.2.13.2.9.2.17 2008/11/22 11:48:42 scottmac Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -114,16 +114,20 @@
} \
}
-#define RES_FROM_OBJECT(res, object) \
+#define RES_FROM_OBJECT_RESTORE_ERH(res, object, error_handling) \
{ \
sqlite_object *obj = (sqlite_object*)
zend_object_store_get_object(object TSRMLS_CC); \
res = obj->u.res; \
if (!res) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No result
set available"); \
+ if (error_handling) \
+ zend_restore_error_handling(error_handling
TSRMLS_CC); \
RETURN_NULL(); \
} \
}
+#define RES_FROM_OBJECT(res, object) RES_FROM_OBJECT_RESTORE_ERH(res, object,
NULL)
+
#define PHP_SQLITE_EMPTY_QUERY \
if (!sql_len) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot execute
empty query."); \
@@ -1454,7 +1458,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.166.2.13.2.9.2.16 2008/11/19
02:00:53 colder Exp $");
+ php_info_print_table_row(2, "PECL Module version",
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.13.2.9.2.17 2008/11/22
11:48:42 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();
@@ -2369,7 +2373,7 @@
zend_restore_error_handling(&error_handling TSRMLS_CC);
return;
}
- RES_FROM_OBJECT(res, object);
+ RES_FROM_OBJECT_RESTORE_ERH(res, object, &error_handling);
if (!ZEND_NUM_ARGS()) {
ce = zend_standard_class_def;
} else {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php