diff options
| author | Damien Regad <dregad@mantisbt.org> | 2015-05-15 10:34:41 +0200 |
|---|---|---|
| committer | Damien Regad <dregad@mantisbt.org> | 2015-05-15 10:34:41 +0200 |
| commit | d63003d9d541df2787798b2e5cce0a7c8fa2c9d6 (patch) | |
| tree | f1ba976c0d5dd34c8ed47467798de0ba9b78ee58 /drivers/adodb-sqlite.inc.php | |
| parent | 9b14451d4c804a2b4929ed00434822ebfa73c837 (diff) | |
| download | adodb-d63003d9d541df2787798b2e5cce0a7c8fa2c9d6.tar.gz adodb-d63003d9d541df2787798b2e5cce0a7c8fa2c9d6.tar.bz2 adodb-d63003d9d541df2787798b2e5cce0a7c8fa2c9d6.zip | |
sqlite3: Fix result-less SQL statements executed twice
The sqlite3 driver relies on SQLite3::query to execute the statement,
which returns an empty SQLite3Result while the ADOConnection::_Execute()
method expects true for handling of result-less queries. This causes the
query to be executed a second time when ADOdb initializes the recordset
for what it wrongly assumes to be a SELECT statement.
This also addresses the same behavior with the sqlite driver, but the
fix was not tested as I don't have a sqlite 2 setup available.
Fixes #99
Diffstat (limited to 'drivers/adodb-sqlite.inc.php')
| -rw-r--r-- | drivers/adodb-sqlite.inc.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/adodb-sqlite.inc.php b/drivers/adodb-sqlite.inc.php index f6a04502..9956c1ba 100644 --- a/drivers/adodb-sqlite.inc.php +++ b/drivers/adodb-sqlite.inc.php @@ -213,6 +213,11 @@ class ADODB_sqlite extends ADOConnection { if (!$rez) { $this->_errorNo = sqlite_last_error($this->_connectionID); } + // If no data was returned, we don't need to create a real recordset + // Note: this code is untested, as I don't have a sqlite2 setup available + elseif (sqlite_num_fields($rez) == 0) { + $rez = true; + } return $rez; } |
