Revert this file to V4.20, since V4.22 broke the autodetection of the bytea datatype.

Bug is reported to the ADODEB-folks:
http://phplens.com/lens/lensforum/msgs.php?id=9849
This commit is contained in:
Carsten Wolff 2004-06-20 11:55:25 +00:00
parent b56a9b86c8
commit 6bec2a4d48

View File

@ -1,6 +1,6 @@
<?php <?php
/* /*
V4.22 15 Apr 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved. V4.20 22 Feb 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license. Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses, Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. the BSD license will take precedence.
@ -791,15 +791,14 @@ class ADORecordSet_postgres64 extends ADORecordSet{
function _initrs() function _initrs()
{ {
global $ADODB_COUNTRECS; global $ADODB_COUNTRECS;
$qid = $this->_queryID; $this->_numOfRows = ($ADODB_COUNTRECS)? @pg_numrows($this->_queryID):-1;
$this->_numOfRows = ($ADODB_COUNTRECS)? @pg_numrows($qid):-1; $this->_numOfFields = @pg_numfields($this->_queryID);
$this->_numOfFields = @pg_numfields($qid);
// cache types for blob decode check // cache types for blob decode check
for ($i=0, $max = $this->_numOfFields; $i < $max; $i++) { for ($i=0, $max = $this->_numOfFields; $i < $max; $i++) {
if (pg_fieldtype($qid,$i) == 'bytea') { $f1 = $this->FetchField($i);
$this->_blobArr[$i] = pg_fieldname($qid,$off); //print_r($f1);
} if ($f1->type == 'bytea') $this->_blobArr[$i] = $f1->name;
} }
} }
@ -826,6 +825,8 @@ class ADORecordSet_postgres64 extends ADORecordSet{
$o->name = @pg_fieldname($this->_queryID,$off); $o->name = @pg_fieldname($this->_queryID,$off);
$o->type = @pg_fieldtype($this->_queryID,$off); $o->type = @pg_fieldtype($this->_queryID,$off);
$o->max_length = @pg_fieldsize($this->_queryID,$off); $o->max_length = @pg_fieldsize($this->_queryID,$off);
//print_r($o);
//print "off=$off name=$o->name type=$o->type len=$o->max_length<br>";
return $o; return $o;
} }