diff options
author | Scott MacVicar <scottmac@php.net> | 2008-11-22 11:48:42 +0000 |
---|---|---|
committer | Scott MacVicar <scottmac@php.net> | 2008-11-22 11:48:42 +0000 |
commit | 7ba273e3b5c72f98272d29460722245db7e4d6eb (patch) | |
tree | e464cc3b450a9318fd155ddf50d3641501a15105 /ext/sqlite | |
parent | 2d738978563de89edeb9d788ed4948f597046f9e (diff) | |
download | php-git-7ba273e3b5c72f98272d29460722245db7e4d6eb.tar.gz |
MFH Error handler isn't properly restored when using fetchObject() with SQLite
Diffstat (limited to 'ext/sqlite')
-rw-r--r-- | ext/sqlite/sqlite.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index ad612e4da7..20bb460bde 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -114,16 +114,20 @@ PHP_INI_END() } \ } -#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."); \ @@ -2369,7 +2373,7 @@ PHP_FUNCTION(sqlite_fetch_object) 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 { |