]> granicus.if.org Git - php/commitdiff
Fix error with initialisation flag being set too early. If encryption is enabled...
authorScott MacVicar <scottmac@php.net>
Mon, 3 Jan 2011 19:15:36 +0000 (19:15 +0000)
committerScott MacVicar <scottmac@php.net>
Mon, 3 Jan 2011 19:15:36 +0000 (19:15 +0000)
Also fix a WS error.

ext/sqlite3/sqlite3.c

index bd2ad9e549ab6faad2bf27f7f6bc09959ede6f7e..d3d92aaa8bf6b99e2aa6d3f5370009af9ecc372e 100644 (file)
@@ -40,7 +40,7 @@ ZEND_DECLARE_MODULE_GLOBALS(sqlite3)
 static PHP_GINIT_FUNCTION(sqlite3);
 static int php_sqlite3_authorizer(void *autharg, int access_type, const char *arg3, const char *arg4, const char *arg5, const char *arg6);
 static void sqlite3_param_dtor(void *data);
-static int php_sqlite3_compare_stmt_zval_free( php_sqlite3_free_list **free_list, zval *statement );
+static int php_sqlite3_compare_stmt_zval_free(php_sqlite3_free_list **free_list, zval *statement);
 
 /* {{{ Error Handler
 */
@@ -149,8 +149,6 @@ PHP_METHOD(sqlite3, open)
                return;
        }
 
-       db_obj->initialised = 1;
-
 #if SQLITE_HAS_CODEC
        if (encryption_key_len > 0) {
                if (sqlite3_key(db_obj->db, encryption_key, encryption_key_len) != SQLITE_OK) {
@@ -160,6 +158,8 @@ PHP_METHOD(sqlite3, open)
        }
 #endif
 
+       db_obj->initialised = 1;
+
 #if PHP_API_VERSION < 20100412
        if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) {
 #else