]> granicus.if.org Git - php/commitdiff
MFH make SQLite3::enableExceptions() return the previous value.
authorScott MacVicar <scottmac@php.net>
Mon, 8 Jun 2009 02:15:54 +0000 (02:15 +0000)
committerScott MacVicar <scottmac@php.net>
Mon, 8 Jun 2009 02:15:54 +0000 (02:15 +0000)
ext/sqlite3/sqlite3.c
ext/sqlite3/tests/sqlite3_enable_exceptions.phpt

index 683c01ae1b7ebc3f59b896a6c0f15f745f6dbc13..50a4e75e9b21d3a44df86811e00d0b04348abba0 100644 (file)
@@ -1109,8 +1109,8 @@ PHP_METHOD(sqlite3, openBlob)
 }
 /* }}} */
 
-/* {{{ proto void SQLite3::enableExceptions([bool enableExceptions = false])
-   Open a blob as a stream which we can read / write to. */
+/* {{{ proto bool SQLite3::enableExceptions([bool enableExceptions = false])
+   Enables an exception error mode. */
 PHP_METHOD(sqlite3, enableExceptions)
 {
        php_sqlite3_db_object *db_obj;
@@ -1123,6 +1123,8 @@ PHP_METHOD(sqlite3, enableExceptions)
                return;
        }
 
+       RETVAL_BOOL(db_obj->exception);
+
        db_obj->exception = enableExceptions;
 }
 /* }}} */
index 5090dde76c4dfdeecc3ca240075bd8b6cd9f934b..ebb59eb2b051df9ca69bacccbe30acc6a15a161a 100644 (file)
@@ -23,9 +23,9 @@ var_dump($db->close());
 echo "Done\n";
 ?>
 --EXPECTF--
-NULL
+bool(false)
 no such table: non_existent_table
-NULL
+bool(true)
 
 Warning: SQLite3::query(): no such table: non_existent_table in %s on line %d