diff options
| author | Damien Regad <dregad@mantisbt.org> | 2025-03-22 01:17:49 +0100 |
|---|---|---|
| committer | Damien Regad <dregad@mantisbt.org> | 2025-03-22 01:17:49 +0100 |
| commit | dacf5b09ff2062c94276ef225a13e882763b50b0 (patch) | |
| tree | 89988e449d0435ecee6bdb63b1426b9bc24414a7 /drivers/adodb-sqlite3.inc.php | |
| parent | 30ad9f1102720e0fe9d9a3ec0aaff930306aedb8 (diff) | |
| parent | 33f466dd2b922bdd765898991e73c8d12673b29a (diff) | |
| download | adodb-dacf5b09ff2062c94276ef225a13e882763b50b0.tar.gz adodb-dacf5b09ff2062c94276ef225a13e882763b50b0.tar.bz2 adodb-dacf5b09ff2062c94276ef225a13e882763b50b0.zip | |
Merge branch 'hotfix/5.22'
# Conflicts:
# adodb.inc.php
# docs/changelog.md
Diffstat (limited to 'drivers/adodb-sqlite3.inc.php')
| -rw-r--r-- | drivers/adodb-sqlite3.inc.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/adodb-sqlite3.inc.php b/drivers/adodb-sqlite3.inc.php index 0cceafb1..e6bc9014 100644 --- a/drivers/adodb-sqlite3.inc.php +++ b/drivers/adodb-sqlite3.inc.php @@ -32,7 +32,6 @@ class ADODB_sqlite3 extends ADOConnection { var $dataProvider = "sqlite"; var $replaceQuote = "''"; // string to use to replace quotes var $concat_operator='||'; - var $_errorNo = 0; var $hasLimit = true; var $hasInsertID = true; /// supports autoincrement ID? var $hasAffectedRows = true; /// supports affected rows for update/delete? @@ -276,17 +275,20 @@ class ADODB_sqlite3 extends ADOConnection { return $this->_connectionID->changes(); } + protected function lastError() + { + $this->_errorMsg = $this->_connectionID->lastErrorMsg(); + $this->_errorCode = $this->_connectionID->lastErrorCode(); + } + function ErrorMsg() { - if ($this->_logsql) { - return $this->_errorMsg; - } - return ($this->_errorNo) ? $this->ErrorNo() : ''; //**tochange? + return $this->_errorMsg; } function ErrorNo() { - return $this->_connectionID->lastErrorCode(); //**tochange?? + return $this->_errorCode; } function SQLDate($fmt, $col=false) @@ -333,7 +335,7 @@ class ADODB_sqlite3 extends ADOConnection { { $rez = $this->_connectionID->query($sql); if ($rez === false) { - $this->_errorNo = $this->_connectionID->lastErrorCode(); + $this->lastError(); } // If no data was returned, we don't need to create a real recordset elseif ($rez->numColumns() == 0) { @@ -645,6 +647,10 @@ class ADODB_sqlite3 extends ADOConnection { // Prepare the statement $stmt = $this->_connectionID->prepare($sql); + if ($stmt === false) { + $this->lastError(); + return false; + } // Set the first bind value equal to value we want to update if (!$stmt->bindValue(1, $val, SQLITE3_BLOB)) { |
