diff options
| -rw-r--r-- | drivers/adodb-postgres64.inc.php | 24 | ||||
| -rw-r--r-- | drivers/adodb-postgres7.inc.php | 12 |
2 files changed, 22 insertions, 14 deletions
diff --git a/drivers/adodb-postgres64.inc.php b/drivers/adodb-postgres64.inc.php index 9583a3b1..f73fd1eb 100644 --- a/drivers/adodb-postgres64.inc.php +++ b/drivers/adodb-postgres64.inc.php @@ -1007,17 +1007,19 @@ class ADORecordSet_postgres64 extends ADORecordSet{ return pg_unescape_bytea($blob); } - function _prepfields() + /** + * Fetches and prepares the RecordSet's fields. + * + * Fixes the blobs if there are any. + */ + protected function _prepFields() { $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode); - return $this->_fixblobs(); - } - function _fixblobs() - { // Check prerequisites and bail early if we do not have what we need. - if (!isset($this->_blobArr)) return false; - if ($this->fields === false) return false; + if (!isset($this->_blobArr) || $this->fields === false) { + return; + } if ($this->fetchMode == PGSQL_NUM || $this->fetchMode == PGSQL_BOTH) { foreach($this->_blobArr as $k => $v) { @@ -1029,7 +1031,6 @@ class ADORecordSet_postgres64 extends ADORecordSet{ $this->fields[$v] = ADORecordSet_postgres64::_decode($this->fields[$v]); } } - return true; } // 10% speedup to move MoveNext to child class @@ -1039,7 +1040,9 @@ class ADORecordSet_postgres64 extends ADORecordSet{ $this->_currentRow++; if ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) { $this->_prepfields(); - if ($this->fields !== false) return true; + if ($this->fields !== false) { + return true; + } } $this->fields = false; $this->EOF = true; @@ -1054,8 +1057,7 @@ class ADORecordSet_postgres64 extends ADORecordSet{ } $this->_prepfields(); - - return (is_array($this->fields)); + return $this->fields !== false; } function _close() diff --git a/drivers/adodb-postgres7.inc.php b/drivers/adodb-postgres7.inc.php index 52b59f71..ddbe7a6e 100644 --- a/drivers/adodb-postgres7.inc.php +++ b/drivers/adodb-postgres7.inc.php @@ -300,7 +300,9 @@ class ADORecordSet_postgres7 extends ADORecordSet_postgres64{ $this->_currentRow++; if ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) { $this->_prepfields(); - if ($this->fields !== false) return true; + if ($this->fields !== false) { + return true; + } } $this->fields = false; $this->EOF = true; @@ -321,9 +323,13 @@ class ADORecordSet_assoc_postgres7 extends ADORecordSet_postgres64{ return false; } - if ($this->_prepfields()) $this->_updatefields(); + $this->_prepfields(); + if ($this->fields !== false) { + $this->_updatefields(); + return true; + } - return (is_array($this->fields)); + return false; } function MoveNext() |
