summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--ext/sqlite3/sqlite3.c6
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;
}