diff options
Diffstat (limited to 'drivers/adodb-postgres64.inc.php')
| -rw-r--r-- | drivers/adodb-postgres64.inc.php | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/adodb-postgres64.inc.php b/drivers/adodb-postgres64.inc.php index 4b1a3260..9583a3b1 100644 --- a/drivers/adodb-postgres64.inc.php +++ b/drivers/adodb-postgres64.inc.php @@ -1007,8 +1007,18 @@ class ADORecordSet_postgres64 extends ADORecordSet{ return pg_unescape_bytea($blob); } + 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 ($this->fetchMode == PGSQL_NUM || $this->fetchMode == PGSQL_BOTH) { foreach($this->_blobArr as $k => $v) { $this->fields[$k] = ADORecordSet_postgres64::_decode($this->fields[$k]); @@ -1019,6 +1029,7 @@ class ADORecordSet_postgres64 extends ADORecordSet{ $this->fields[$v] = ADORecordSet_postgres64::_decode($this->fields[$v]); } } + return true; } // 10% speedup to move MoveNext to child class @@ -1027,11 +1038,8 @@ class ADORecordSet_postgres64 extends ADORecordSet{ if (!$this->EOF) { $this->_currentRow++; if ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) { - $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode); - if (is_array($this->fields) && $this->fields) { - if (isset($this->_blobArr)) $this->_fixblobs(); - return true; - } + $this->_prepfields(); + if ($this->fields !== false) return true; } $this->fields = false; $this->EOF = true; @@ -1045,9 +1053,7 @@ class ADORecordSet_postgres64 extends ADORecordSet{ return false; } - $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode); - - if ($this->fields && isset($this->_blobArr)) $this->_fixblobs(); + $this->_prepfields(); return (is_array($this->fields)); } |
