Merge branch '2.2' into 2.3

This commit is contained in:
Robbie Averill 2019-11-27 17:27:36 -08:00
commit 3d50b3f9ec
1 changed files with 31 additions and 20 deletions

View File

@ -58,8 +58,10 @@ class PostgreSQLQuery extends Query
public function seek($row)
{
pg_result_seek($this->handle, $row);
return $this->nextRecord();
// Specifying the zero-th record here will reset the pointer
$result = pg_fetch_array($this->handle, $row, PGSQL_NUM);
return $this->parseResult($result);
}
public function numRecords()
@ -73,6 +75,18 @@ class PostgreSQLQuery extends Query
// Correct non-string types
if ($row) {
return $this->parseResult($row);
}
return false;
}
/**
* @param array $row
* @return array
*/
protected function parseResult(array $row)
{
$record = [];
foreach ($row as $i => $v) {
@ -92,7 +106,4 @@ class PostgreSQLQuery extends Query
return $record;
}
return false;
}
}