cvs: pear /MDB2/MDB2/Driver pgsql.php /MDB2/MDB2/Driver/Datatype pgsql.php

From: Date: Sat, 14 Oct 2006 16:21:15 +0000
Subject: cvs: pear /MDB2/MDB2/Driver pgsql.php /MDB2/MDB2/Driver/Datatype pgsql.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-42558@lists.php.net to get a copy of this message
lsmith Sat Oct 14 16:21:15 2006 UTC Modified files: /pear/MDB2/MDB2/Driver/Datatype pgsql.php /pear/MDB2/MDB2/Driver pgsql.php Log: - comment out non working code (Bug #9024) - added $connection to pg_escape_*() calls (due to issues in LOB handling partially disable) http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/pgsql.php?r1=1.76&r2=1.77&diff_format=u Index: pear/MDB2/MDB2/Driver/Datatype/pgsql.php diff -u pear/MDB2/MDB2/Driver/Datatype/pgsql.php:1.76 pear/MDB2/MDB2/Driver/Datatype/pgsql.php:1.77 --- pear/MDB2/MDB2/Driver/Datatype/pgsql.php:1.76 Sat Oct 14 13:42:02 2006 +++ pear/MDB2/MDB2/Driver/Datatype/pgsql.php Sat Oct 14 16:21:15 2006 @@ -42,7 +42,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.76 2006/10/14 13:42:02 lsmith Exp $ +// $Id: pgsql.php,v 1.77 2006/10/14 16:21:15 lsmith Exp $ require_once 'MDB2/Driver/Datatype/Common.php'; @@ -264,7 +264,20 @@ if (!$quote) { return $value; } - $value = pg_escape_bytea($value); + // todo: check why LOB tests fail + if (false && version_compare(PHP_VERSION, '5.2.0RC5', '>=')) { + $db =& $this->getDBInstance(); + if (PEAR::isError($db)) { + return $db; + } + $connection = $db->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + $value = @pg_escape_bytea($connection, $value); + } else { + $value = @pg_escape_bytea($value); + } return "'".$value."'"; } http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/pgsql.php?r1=1.158&r2=1.159&diff_format=u Index: pear/MDB2/MDB2/Driver/pgsql.php diff -u pear/MDB2/MDB2/Driver/pgsql.php:1.158 pear/MDB2/MDB2/Driver/pgsql.php:1.159 --- pear/MDB2/MDB2/Driver/pgsql.php:1.158 Sat Oct 14 13:42:02 2006 +++ pear/MDB2/MDB2/Driver/pgsql.php Sat Oct 14 16:21:15 2006 @@ -43,7 +43,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.158 2006/10/14 13:42:02 lsmith Exp $ +// $Id: pgsql.php,v 1.159 2006/10/14 16:21:15 lsmith Exp $ /** * MDB2 PostGreSQL driver @@ -196,7 +196,15 @@ if ($escape_wildcards) { $text = $this->escapePattern($text); } - $text = @pg_escape_string($text); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + if (version_compare(PHP_VERSION, '5.2.0RC5', '>=')) { + $text = @pg_escape_string($connection, $text); + } else { + $text = @pg_escape_string($text); + } return $text; } @@ -675,10 +683,13 @@ $query = substr($query, 0, -1); } if ($is_manip) { +/* +todo: add missing preg_match() all to build $match $manip = preg_replace('/^(DELETE FROM|UPDATE).*$/', '\\1', $query); $from = $match[2]; $where = $match[3]; $query = $manip.' '.$from.' WHERE ctid=(SELECT ctid FROM '.$from.' '.$where.' LIMIT '.$limit.')'; +*/ } else { $query.= " LIMIT $limit OFFSET $offset"; }

« previous php.pear.cvs (#42558) next »