scottmac Sat Nov 22 11:48:38 2008 UTC
Modified files:
/php-src/ext/sqlite sqlite.c
Log:
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.218&r2=1.219&diff_format=u
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.218 php-src/ext/sqlite/sqlite.c:1.219
--- php-src/ext/sqlite/sqlite.c:1.218 Wed Nov 19 01:59:07 2008
+++ php-src/ext/sqlite/sqlite.c Sat Nov 22 11:48:38 2008
@@ -17,7 +17,7 @@
| Marcus Boerger <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
- $Id: sqlite.c,v 1.218 2008/11/19 01:59:07 colder Exp $
+ $Id: sqlite.c,v 1.219 2008/11/22 11:48:38 scottmac Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -160,16 +160,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"); \
@@ -1546,7 +1550,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.218 2008/11/19 01:59:07 colder
Exp $");
+ php_info_print_table_row(2, "PECL Module version",
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.219 2008/11/22 11:48:38 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();
@@ -2573,7 +2577,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