diff options
| author | Damien Regad <dregad@mantisbt.org> | 2023-04-16 18:24:54 +0200 |
|---|---|---|
| committer | Damien Regad <dregad@mantisbt.org> | 2023-05-22 18:19:05 +0200 |
| commit | 5c9e24cf98409004da2a5e5bd80eeec82c5a3997 (patch) | |
| tree | 3c864d794fcb0ab5ea4d165e55d9fb153fc375ae /drivers/adodb-sqlite.inc.php | |
| parent | 86839df94adce501ff9faf8a9f6b79399e1ce56b (diff) | |
| download | adodb-5c9e24cf98409004da2a5e5bd80eeec82c5a3997.tar.gz adodb-5c9e24cf98409004da2a5e5bd80eeec82c5a3997.tar.bz2 adodb-5c9e24cf98409004da2a5e5bd80eeec82c5a3997.zip | |
Set $fetchMode property in ADORecordSet constructor
This reduces code duplication as the logic to initialize $fetchMode from
$ADODB_FETCH_MODE global was repeated in most drivers.
$adodbFetchMode is systematically initialized as well now; previously it
was only set in those drivers having specific fetch modes.
Fixes #958
Diffstat (limited to 'drivers/adodb-sqlite.inc.php')
| -rw-r--r-- | drivers/adodb-sqlite.inc.php | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/adodb-sqlite.inc.php b/drivers/adodb-sqlite.inc.php index d41829c0..d4cf19be 100644 --- a/drivers/adodb-sqlite.inc.php +++ b/drivers/adodb-sqlite.inc.php @@ -425,14 +425,11 @@ class ADORecordset_sqlite extends ADORecordSet { var $databaseType = "sqlite"; var $bind = false; - function __construct($queryID,$mode=false) + function __construct($queryID, $mode=false) { + parent::__construct($queryID, $mode); - if ($mode === false) { - global $ADODB_FETCH_MODE; - $mode = $ADODB_FETCH_MODE; - } - switch($mode) { + switch ($mode) { case ADODB_FETCH_NUM: $this->fetchMode = SQLITE_NUM; break; @@ -443,9 +440,6 @@ class ADORecordset_sqlite extends ADORecordSet { $this->fetchMode = SQLITE_BOTH; break; } - $this->adodbFetchMode = $mode; - - $this->_queryID = $queryID; $this->_inited = true; $this->fields = array(); @@ -462,7 +456,6 @@ class ADORecordset_sqlite extends ADORecordSet { return $this->_queryID; } - function FetchField($fieldOffset = -1) { $fld = new ADOFieldObject; |
