From 6d406ccedf10aacffab313aa9a7cbb56218b5400 Mon Sep 17 00:00:00 2001 From: Scott MacVicar Date: Mon, 19 Jan 2009 22:43:58 +0000 Subject: [PATCH] Fixed bug #47141 - Unable to fetch error messages after the database can't be opened. --- NEWS | 2 ++ ext/sqlite3/sqlite3.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index ab9bbaaaaa..2c8307ed31 100644 --- a/NEWS +++ b/NEWS @@ -47,6 +47,8 @@ PHP NEWS - Fixed building of pdo_sqlite without sqlite3. (Scott) +- Fixed bug #47141 (Unable to fetch error messages from SQLite + when the database can't be opened). (Scott) - Fixed bug #47050 (mysqli_poll() modifies improper variables). (Johannes) - Fixed bug #47045 (SplObjectStorage instances compared with ==). (Etienne) - Fixed bug #46979 (use with non-compound name *has* effect). (Dmitry) diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 42585418d4..2b11596e1b 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -229,7 +229,7 @@ PHP_METHOD(sqlite3, lastErrorCode) zval *object = getThis(); db_obj = (php_sqlite3_db_object *)zend_object_store_get_object(object TSRMLS_CC); - SQLITE3_CHECK_INITIALIZED(db_obj->initialised, SQLite3) + SQLITE3_CHECK_INITIALIZED(db_obj->db, SQLite3) if (zend_parse_parameters_none() == FAILURE) { return; @@ -247,7 +247,7 @@ PHP_METHOD(sqlite3, lastErrorMsg) zval *object = getThis(); db_obj = (php_sqlite3_db_object *)zend_object_store_get_object(object TSRMLS_CC); - SQLITE3_CHECK_INITIALIZED(db_obj->initialised, SQLite3) + SQLITE3_CHECK_INITIALIZED(db_obj->db, SQLite3) if (zend_parse_parameters_none() == FAILURE) { return; @@ -943,7 +943,7 @@ PHP_METHOD(sqlite3stmt, clear) } if (sqlite3_clear_bindings(stmt_obj->stmt) != SQLITE_OK) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to execute statement: %s", sqlite3_errmsg(sqlite3_db_handle(stmt_obj->stmt))); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to clear statement: %s", sqlite3_errmsg(sqlite3_db_handle(stmt_obj->stmt))); RETURN_FALSE; } -- 2.50.1