From 3756f9726276e59e9de715e66540eb3ff9a591ae Mon Sep 17 00:00:00 2001 From: michalsn Date: Sat, 27 Sep 2025 20:43:43 +0200 Subject: [PATCH 1/2] fix: SQLite3 password handling for empty string --- system/Database/SQLite3/Connection.php | 2 +- user_guide_src/source/changelogs/v4.6.4.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/Database/SQLite3/Connection.php b/system/Database/SQLite3/Connection.php index 7c3ad66e6fd5..ec73a75b18bd 100644 --- a/system/Database/SQLite3/Connection.php +++ b/system/Database/SQLite3/Connection.php @@ -107,7 +107,7 @@ public function connect(bool $persistent = false) $this->database = WRITEPATH . $this->database; } - $sqlite = ($this->password === null || $this->password !== '') + $sqlite = ($this->password === null || $this->password === '') ? new SQLite3($this->database) : new SQLite3($this->database, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, $this->password); diff --git a/user_guide_src/source/changelogs/v4.6.4.rst b/user_guide_src/source/changelogs/v4.6.4.rst index ed9909d0face..53677e09b07a 100644 --- a/user_guide_src/source/changelogs/v4.6.4.rst +++ b/user_guide_src/source/changelogs/v4.6.4.rst @@ -40,6 +40,7 @@ Bugs Fixed - **Database:** Fixed a bug in ``Database::connect()`` which was causing to store non-shared connection instances in shared cache. - **Database:** Fixed a bug in ``Connection::getFieldData()`` for ``SQLSRV`` and ``OCI8`` where extra characters were returned in column default values (specific to those handlers), instead of following the convention used by other drivers. - **Database:** Fixed a bug in ``BaseBuilder::compileOrderBy()`` where the method could overwrite ``QBOrderBy`` with a string instead of keeping it as an array, causing type errors and preventing additional ``ORDER BY`` clauses from being appended. +- **Database:** Fixed a bug in ``SQLite3`` where an incorrect condition caused the password parameter to be ignored when it was an empty string. - **Forge:** Fixed a bug in ``Postgre`` and ``SQLSRV`` where changing a column's default value using ``Forge::modifyColumn()`` method produced incorrect SQL syntax. - **Model:** Fixed a bug in ``Model::replace()`` where ``created_at`` field (when available) wasn't set correctly. - **Model:** Fixed a bug in ``Model::insertBatch()`` and ``Model::updateBatch()`` where casts were not applied to inserted or updated values. From 9f6c771fe57865aad85d061038a5c5868c13879d Mon Sep 17 00:00:00 2001 From: michalsn Date: Sat, 27 Sep 2025 21:14:47 +0200 Subject: [PATCH 2/2] update changelog --- user_guide_src/source/changelogs/v4.6.4.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/changelogs/v4.6.4.rst b/user_guide_src/source/changelogs/v4.6.4.rst index 53677e09b07a..116c371d10c2 100644 --- a/user_guide_src/source/changelogs/v4.6.4.rst +++ b/user_guide_src/source/changelogs/v4.6.4.rst @@ -40,7 +40,7 @@ Bugs Fixed - **Database:** Fixed a bug in ``Database::connect()`` which was causing to store non-shared connection instances in shared cache. - **Database:** Fixed a bug in ``Connection::getFieldData()`` for ``SQLSRV`` and ``OCI8`` where extra characters were returned in column default values (specific to those handlers), instead of following the convention used by other drivers. - **Database:** Fixed a bug in ``BaseBuilder::compileOrderBy()`` where the method could overwrite ``QBOrderBy`` with a string instead of keeping it as an array, causing type errors and preventing additional ``ORDER BY`` clauses from being appended. -- **Database:** Fixed a bug in ``SQLite3`` where an incorrect condition caused the password parameter to be ignored when it was an empty string. +- **Database:** Fixed a bug in ``SQLite3`` where the password parameter was ignored unless it was an empty string. - **Forge:** Fixed a bug in ``Postgre`` and ``SQLSRV`` where changing a column's default value using ``Forge::modifyColumn()`` method produced incorrect SQL syntax. - **Model:** Fixed a bug in ``Model::replace()`` where ``created_at`` field (when available) wasn't set correctly. - **Model:** Fixed a bug in ``Model::insertBatch()`` and ``Model::updateBatch()`` where casts were not applied to inserted or updated values.