Commit ea0d0f69 authored by Gold's avatar Gold
Browse files

Bug 1945922 - Fix fetchField()

Hotfix for critical bug resolved in v5.21.2.

https://github.com/ADOdb/ADOdb/issues/752



behatnotneeded

Change-Id: I0d136045a6a4bd6ffc4469b98ab9f8f26daa5c7c
Signed-off-by: default avatarGold <gold@catalyst.net.nz>
parent 232ce9bb
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -986,14 +986,14 @@ class ADORecordSet_postgres64 extends ADORecordSet{
		return $this->fields[$this->bind[strtoupper($colname)]];
	}

	function fetchField($fieldOffset)
	function fetchField($fieldOffset = 0)
	{
		// offsets begin at 0

		$o = new ADOFieldObject();
		$o->name = @pg_field_name($this->_queryID,$off);
		$o->type = @pg_field_type($this->_queryID,$off);
		$o->max_length = @pg_field_size($this->_queryID,$off);
		$o->name = @pg_field_name($this->_queryID, $fieldOffset);
		$o->type = @pg_field_type($this->_queryID, $fieldOffset);
		$o->max_length = @pg_field_size($this->_queryID, $fieldOffset);
		return $o;
	}