cvs: pear /MDB2 MDB2.php /MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php querysim.php sqlite.php
/MDB2/MDB2/Driver/Datatype ibase.php /MDB2/MDB2/Driver/Manager pgsql.php /MDB2/MDB2/Wrapper peardb.php
| From: | Lukas Smith | Date: | Sat, 15 Oct 2005 08:39:33 +0000 |
| Subject: | cvs: pear /MDB2 MDB2.php /MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php querysim.php sqlite.php /MDB2/MDB2/Driver/Datatype ibase.php /MDB2/MDB2/Driver/Manager pgsql.php /MDB2/MDB2/Wrapper peardb.php |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35567@lists.php.net to get a copy of this message | ||
lsmith Sat Oct 15 04:39:33 2005 EDT
Modified files:
/pear/MDB2 MDB2.php
/pear/MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php
mysqli.php oci8.php pgsql.php querysim.php
sqlite.php
/pear/MDB2/MDB2/Driver/Datatype ibase.php
/pear/MDB2/MDB2/Driver/Manager pgsql.php
/pear/MDB2/MDB2/Wrapper peardb.php
Log:
- expand usage of getConnection()
http://cvs.php.net/diff.php/pear/MDB2/MDB2.php?r1=1.129&r2=1.130&ty=u Index: pear/MDB2/MDB2.php diff -u pear/MDB2/MDB2.php:1.129 pear/MDB2/MDB2.php:1.130 --- pear/MDB2/MDB2.php:1.129 Fri Oct 14 18:39:02 2005 +++ pear/MDB2/MDB2.php Sat Oct 15 04:39:22 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: MDB2.php,v 1.129 2005/10/14 22:39:02 lsmith Exp $ +// $Id: MDB2.php,v 1.130 2005/10/15 08:39:22 lsmith Exp $ // /** @@ -1837,12 +1837,12 @@ $this->row_offset = $this->row_limit = 0; $query = $this->_modifyQuery($query, $isManip, $limit, $offset); - $connected = $this->connect(); - if (PEAR::isError($connected)) { - return $connected; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $result = $this->_doQuery($query, $isManip, $this->connection, false); + $result = $this->_doQuery($query, $isManip, $connection, false); if (PEAR::isError($result)) { return $result; } @@ -1912,12 +1912,12 @@ $this->row_offset = $this->row_limit = 0; $query = $this->_modifyQuery($query, $isManip, $limit, $offset); - $connected = $this->connect(); - if (PEAR::isError($connected)) { - return $connected; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $result = $this->_doQuery($query, $isManip, $this->connection, $this->database_name); + $result = $this->_doQuery($query, $isManip, $connection, $this->database_name); if (PEAR::isError($result)) { return $result; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/fbsql.php?r1=1.72&r2=1.73&ty=u Index: pear/MDB2/MDB2/Driver/fbsql.php diff -u pear/MDB2/MDB2/Driver/fbsql.php:1.72 pear/MDB2/MDB2/Driver/fbsql.php:1.73 --- pear/MDB2/MDB2/Driver/fbsql.php:1.72 Thu Oct 6 05:37:13 2005 +++ pear/MDB2/MDB2/Driver/fbsql.php Sat Oct 15 04:39:26 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.72 2005/10/06 09:37:13 lsmith Exp $ +// $Id: fbsql.php,v 1.73 2005/10/15 08:39:26 lsmith Exp $ // /** @@ -314,11 +314,10 @@ } if (is_null($connection)) { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $connection = $this->connection; } if (is_null($database_name)) { $database_name = $this->database_name; @@ -431,7 +430,11 @@ */ function lastInsertID($table = null, $field = null) { - $value = @fbsql_insert_id($this->connection); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + $value = @fbsql_insert_id($connection); if (!$value) { return $this->raiseError(); } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/ibase.php?r1=1.107&r2=1.108&ty=u Index: pear/MDB2/MDB2/Driver/ibase.php diff -u pear/MDB2/MDB2/Driver/ibase.php:1.107 pear/MDB2/MDB2/Driver/ibase.php:1.108 --- pear/MDB2/MDB2/Driver/ibase.php:1.107 Fri Oct 14 17:59:52 2005 +++ pear/MDB2/MDB2/Driver/ibase.php Sat Oct 15 04:39:26 2005 @@ -43,7 +43,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.107 2005/10/14 21:59:52 quipo Exp $ +// $Id: ibase.php,v 1.108 2005/10/15 08:39:26 lsmith Exp $ /** * MDB2 FireBird/InterBase driver @@ -219,11 +219,14 @@ */ function &getConnection() { + if ($this->in_transaction) { + return $this->transaction_id; + } $result = $this->connect(); if (PEAR::isError($result)) { return $result; } - return $this->in_transaction ? $this->transaction_id : $this->connection; + return $this->connection; } // }}} @@ -453,14 +456,9 @@ } if (is_null($connection)) { - if ($this->in_transaction) { - $connection = $this->transaction_id; - } else { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; - } - $connection = $this->connection; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } } $result = ibase_query($connection, $query); @@ -477,51 +475,6 @@ } // }}} - // {{{ query() - - /** - * Send a query to the database and return any results - * - * @param string $query the SQL query - * @param mixed $types array that contains the types of the columns in - * the result set - * @param mixed $result_class string which specifies which result class to use - * @param mixed $result_wrap_class string which specifies which class to wrap results in - * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure - * @access public - */ - function &query($query, $types = null, $result_class = true, $result_wrap_class = false) - { - $isManip = MDB2::isManip($query); - $offset = $this->row_offset; - $limit = $this->row_limit; - $this->row_offset = $this->row_limit = 0; - $query = $this->_modifyQuery($query, $isManip, $limit, $offset); - - $connected = $this->connect(); - if (PEAR::isError($connected)) { - return $connected; - } - - $connection = $this->in_transaction - ? $this->transaction_id : $this->connection; - - $result = $this->_doQuery($query, $isManip, $connection, $this->database_name); - if (PEAR::isError($result)) { - return $result; - } - - // check for integers instead of manip since drivers may do some - // custom checks not covered by MDB2::isManip() - if (is_int($result)) { - return $result; - } - - $result =& $this->_wrapResult($result, $types, $result_class, $result_wrap_class, $limit, $offset); - return $result; - } - - // }}} // {{{ _modifyQuery() /** @@ -626,7 +579,10 @@ $position = $p_position; } } - $connection = ($this->in_transaction ? $this->transaction_id : $this->connection); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } $statement = ibase_prepare($connection, $query); $class_name = 'MDB2_Statement_'.$this->phptype; @@ -1126,12 +1082,10 @@ return $null; } - $connected = $this->db->connect(); - if (PEAR::isError($connected)) { - return $connected; - } - $connection = $this->db->in_transaction - ? $this->db->transaction_id : $this->db->connection; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } $parameters = array(0 => $this->statement); $i = 0; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mssql.php?r1=1.83&r2=1.84&ty=u Index: pear/MDB2/MDB2/Driver/mssql.php diff -u pear/MDB2/MDB2/Driver/mssql.php:1.83 pear/MDB2/MDB2/Driver/mssql.php:1.84 --- pear/MDB2/MDB2/Driver/mssql.php:1.83 Mon Oct 10 08:28:12 2005 +++ pear/MDB2/MDB2/Driver/mssql.php Sat Oct 15 04:39:27 2005 @@ -43,7 +43,7 @@ // | Author: Frank M. Kromann <frank@kromann.info> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.83 2005/10/10 12:28:12 lsmith Exp $ +// $Id: mssql.php,v 1.84 2005/10/15 08:39:27 lsmith Exp $ // // {{{ Class MDB2_Driver_mssql /** @@ -289,7 +289,7 @@ if ((bool) ini_get('mssql.datetimeconvert')) { ini_set('mssql.datetimeconvert', '0'); } - @mssql_query('SET DATEFORMAT ymd', $this->connection); + @mssql_query('SET DATEFORMAT ymd', $connection); return MDB2_OK; } @@ -339,11 +339,10 @@ } if (is_null($connection)) { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $connection = $this->connection; } if (is_null($database_name)) { $database_name = $this->database_name; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mysql.php?r1=1.75&r2=1.76&ty=u Index: pear/MDB2/MDB2/Driver/mysql.php diff -u pear/MDB2/MDB2/Driver/mysql.php:1.75 pear/MDB2/MDB2/Driver/mysql.php:1.76 --- pear/MDB2/MDB2/Driver/mysql.php:1.75 Thu Oct 6 05:37:13 2005 +++ pear/MDB2/MDB2/Driver/mysql.php Sat Oct 15 04:39:27 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.75 2005/10/06 09:37:13 lsmith Exp $ +// $Id: mysql.php,v 1.76 2005/10/15 08:39:27 lsmith Exp $ // /** @@ -437,11 +437,10 @@ } if (is_null($connection)) { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $connection = $this->connection; } if (is_null($database_name)) { $database_name = $this->database_name; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mysqli.php?r1=1.40&r2=1.41&ty=u Index: pear/MDB2/MDB2/Driver/mysqli.php diff -u pear/MDB2/MDB2/Driver/mysqli.php:1.40 pear/MDB2/MDB2/Driver/mysqli.php:1.41 --- pear/MDB2/MDB2/Driver/mysqli.php:1.40 Thu Oct 6 05:37:14 2005 +++ pear/MDB2/MDB2/Driver/mysqli.php Sat Oct 15 04:39:27 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.40 2005/10/06 09:37:14 lsmith Exp $ +// $Id: mysqli.php,v 1.41 2005/10/15 08:39:27 lsmith Exp $ // /** @@ -166,7 +166,11 @@ */ function escape($text) { - return @mysqli_escape_string($this->connection, $text); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + return @mysqli_escape_string($connection, $text); } // }}} @@ -435,11 +439,10 @@ } if (is_null($connection)) { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $connection = $this->connection; } if (is_null($database_name)) { $database_name = $this->database_name; @@ -583,7 +586,11 @@ $position = $p_position; } } - $statement = @mysqli_prepare($this->connection, $query); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + $statement = @mysqli_prepare($connection, $query); $class_name = 'MDB2_Statement_'.$this->phptype; $obj =& new $class_name($this, $statement, $query, $types, $result_types); return $obj; @@ -730,7 +737,11 @@ } return $result; } - $value = @mysqli_insert_id($this->connection); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + $value = @mysqli_insert_id($connection); if (is_numeric($value)) { $query = "DELETE FROM $sequence_name WHERE ".$this->options['seqcol_name']." < $value"; $result = $this->_doQuery($query, true); @@ -754,7 +765,11 @@ */ function lastInsertID($table = null, $field = null) { - $value = @mysqli_insert_id($this->connection); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + $value = @mysqli_insert_id($connection); if (!$value) { return $this->raiseError(); } @@ -1012,9 +1027,9 @@ return $null; } - $connected = $this->db->connect(); - if (PEAR::isError($connected)) { - return $connected; + $connection = $db->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } if (!empty($this->values)) { http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/oci8.php?r1=1.93&r2=1.94&ty=u Index: pear/MDB2/MDB2/Driver/oci8.php diff -u pear/MDB2/MDB2/Driver/oci8.php:1.93 pear/MDB2/MDB2/Driver/oci8.php:1.94 --- pear/MDB2/MDB2/Driver/oci8.php:1.93 Mon Oct 10 04:22:44 2005 +++ pear/MDB2/MDB2/Driver/oci8.php Sat Oct 15 04:39:28 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.93 2005/10/10 08:22:44 lsmith Exp $ +// $Id: oci8.php,v 1.94 2005/10/15 08:39:28 lsmith Exp $ /** * MDB2 OCI8 driver @@ -189,7 +189,11 @@ 'commit: transaction changes are being auto committed'); } if ($this->uncommitedqueries) { - if (!@OCICommit($this->connection)) { + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + if (!@OCICommit($connection)) { return $this->raiseError(); } $this->uncommitedqueries = 0; @@ -216,7 +220,11 @@ 'rollback: transactions can not be rolled back when changes are auto committed'); } if ($this->uncommitedqueries) { - if (!@OCIRollback($this->connection)) { + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + if (!@OCIRollback($connection)) { return $this->raiseError(); } $this->uncommitedqueries = 0; @@ -446,11 +454,10 @@ } if (is_null($connection)) { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $connection = $this->connection; } $result = @OCIParse($connection, $query); @@ -595,7 +602,11 @@ if (is_array($types)) { $query.= $columns.$variables; } - $statement = @OCIParse($this->connection, $query); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + $statement = @OCIParse($connection, $query); if (!$statement) { $err =& $this->raiseError(MDB2_ERROR, null, null, 'Could not create statement'); @@ -1047,9 +1058,9 @@ return $null; } - $connected = $this->db->connect(); - if (PEAR::isError($connected)) { - return $connected; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } $result = MDB2_OK; @@ -1072,7 +1083,7 @@ } } $lobs[$i]['value'] = $value; - $lobs[$i]['descriptor'] = @OCINewDescriptor($this->db->connection, OCI_D_LOB); + $lobs[$i]['descriptor'] = @OCINewDescriptor($connection, OCI_D_LOB); if (!is_object($lobs[$i]['descriptor'])) { $result = $this->db->raiseError(); break; @@ -1119,7 +1130,7 @@ if (!PEAR::isError($result)) { if (!$this->db->in_transaction) { - if (!@OCICommit($this->db->connection)) { + if (!@OCICommit($connection)) { $result = $this->db->raiseError(); } } else { http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/pgsql.php?r1=1.74&r2=1.75&ty=u Index: pear/MDB2/MDB2/Driver/pgsql.php diff -u pear/MDB2/MDB2/Driver/pgsql.php:1.74 pear/MDB2/MDB2/Driver/pgsql.php:1.75 --- pear/MDB2/MDB2/Driver/pgsql.php:1.74 Thu Oct 6 05:37:15 2005 +++ pear/MDB2/MDB2/Driver/pgsql.php Sat Oct 15 04:39:28 2005 @@ -43,7 +43,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.74 2005/10/06 09:37:15 lsmith Exp $ +// $Id: pgsql.php,v 1.75 2005/10/15 08:39:28 lsmith Exp $ /** * MDB2 PostGreSQL driver @@ -451,11 +451,10 @@ } if (is_null($connection)) { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $connection = $this->connection; } $result = @pg_query($connection, $query); http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/querysim.php?r1=1.43&r2=1.44&ty=u Index: pear/MDB2/MDB2/Driver/querysim.php diff -u pear/MDB2/MDB2/Driver/querysim.php:1.43 pear/MDB2/MDB2/Driver/querysim.php:1.44 --- pear/MDB2/MDB2/Driver/querysim.php:1.43 Wed Oct 5 08:40:28 2005 +++ pear/MDB2/MDB2/Driver/querysim.php Sat Oct 15 04:39:29 2005 @@ -61,7 +61,7 @@ // | please contact Alan Richmond. | // +----------------------------------------------------------------------+ // -// $Id: querysim.php,v 1.43 2005/10/05 12:40:28 lsmith Exp $ +// $Id: querysim.php,v 1.44 2005/10/15 08:39:29 lsmith Exp $ // /* @@ -377,15 +377,19 @@ { $buffer = ''; if ($this->opened_persistent) { - while (!feof($this->connection)) { - $buffer.= fgets($this->connection, 1024); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + while (!feof($connection)) { + $buffer.= fgets($connection, 1024); } } else { - $this->connection = @fopen($this->connected_database_name, 'r'); - while (!feof($this->connection)) { - $buffer.= fgets($this->connection, 1024); + $connection = @fopen($this->connected_database_name, 'r'); + while (!feof($connection)) { + $buffer.= fgets($connection, 1024); } - $this->connection = @fclose($this->connection); + @fclose($connection); } return $buffer; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/sqlite.php?r1=1.76&r2=1.77&ty=u Index: pear/MDB2/MDB2/Driver/sqlite.php diff -u pear/MDB2/MDB2/Driver/sqlite.php:1.76 pear/MDB2/MDB2/Driver/sqlite.php:1.77 --- pear/MDB2/MDB2/Driver/sqlite.php:1.76 Thu Oct 6 05:37:15 2005 +++ pear/MDB2/MDB2/Driver/sqlite.php Sat Oct 15 04:39:29 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: sqlite.php,v 1.76 2005/10/06 09:37:15 lsmith Exp $ +// $Id: sqlite.php,v 1.77 2005/10/15 08:39:29 lsmith Exp $ // /** @@ -367,11 +367,10 @@ } if (is_null($connection)) { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $connection = $this->connection; } $function = $this->options['result_buffering'] @@ -568,7 +567,11 @@ } return $result; } - $value = @sqlite_last_insert_rowid($this->connection); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + $value = @sqlite_last_insert_rowid($connection); if (is_numeric($value) && PEAR::isError($this->_doQuery("DELETE FROM $sequence_name WHERE ".$this->options['seqcol_name']." < $value", true)) ) { @@ -590,7 +593,11 @@ */ function lastInsertID($table = null, $field = null) { - $value = @sqlite_last_insert_rowid($this->connection); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + $value = @sqlite_last_insert_rowid($connection); if (!$value) { return $this->raiseError(); } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Datatype/ibase.php?r1=1.46&r2=1.47&ty=u Index: pear/MDB2/MDB2/Driver/Datatype/ibase.php diff -u pear/MDB2/MDB2/Driver/Datatype/ibase.php:1.46 pear/MDB2/MDB2/Driver/Datatype/ibase.php:1.47 --- pear/MDB2/MDB2/Driver/Datatype/ibase.php:1.46 Fri Oct 14 19:29:55 2005 +++ pear/MDB2/MDB2/Driver/Datatype/ibase.php Sat Oct 15 04:39:30 2005 @@ -44,7 +44,7 @@ // | Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.46 2005/10/14 23:29:55 quipo Exp $ +// $Id: ibase.php,v 1.47 2005/10/15 08:39:30 lsmith Exp $ require_once 'MDB2/Driver/Datatype/Common.php'; @@ -215,9 +215,11 @@ return $db; } - if (PEAR::isError($connect = $db->connect())) { - return $connect; + $connection = $db->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } + $close = true; if (is_resource($value)) { $close = false; @@ -232,15 +234,7 @@ @rewind($fp); $value = $fp; } - if ($db->in_transaction) { - $blob_id = @ibase_blob_import($db->transaction_id, $value); - } else { - $connection = $db->getConnection(); - if (PEAR::isError($connection)) { - return $connection; - } - $blob_id = @ibase_blob_import($connection, $value); - } + $blob_id = @ibase_blob_import($db->transaction_id, $value); if ($close) { @fclose($value); } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Manager/pgsql.php?r1=1.36&r2=1.37&ty=u Index: pear/MDB2/MDB2/Driver/Manager/pgsql.php diff -u pear/MDB2/MDB2/Driver/Manager/pgsql.php:1.36 pear/MDB2/MDB2/Driver/Manager/pgsql.php:1.37 --- pear/MDB2/MDB2/Driver/Manager/pgsql.php:1.36 Fri Oct 14 18:33:05 2005 +++ pear/MDB2/MDB2/Driver/Manager/pgsql.php Sat Oct 15 04:39:30 2005 @@ -42,7 +42,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.36 2005/10/14 22:33:05 lsmith Exp $ +// $Id: pgsql.php,v 1.37 2005/10/15 08:39:30 lsmith Exp $ require_once 'MDB2/Driver/Manager/Common.php'; @@ -472,7 +472,7 @@ } $subquery = "SELECT indexrelid FROM pg_index, pg_class"; - $subquery.= " WHERE (pg_class.relname='$table') AND (pg_class.oid=pg_index.indrelid)"; + $subquery.= " WHERE pg_class.relname='$table' AND pg_class.oid=pg_index.indrelid AND indisprimary != 't'"; $result = $db->queryCol("SELECT relname FROM pg_class WHERE oid IN ($subquery)"); if (PEAR::isError($result)) { return $result; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Wrapper/peardb.php?r1=1.34&r2=1.35&ty=u Index: pear/MDB2/MDB2/Wrapper/peardb.php diff -u pear/MDB2/MDB2/Wrapper/peardb.php:1.34 pear/MDB2/MDB2/Wrapper/peardb.php:1.35 --- pear/MDB2/MDB2/Wrapper/peardb.php:1.34 Mon Sep 26 10:42:01 2005 +++ pear/MDB2/MDB2/Wrapper/peardb.php Sat Oct 15 04:39:30 2005 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: peardb.php,v 1.34 2005/09/26 14:42:01 lsmith Exp $ +// $Id: peardb.php,v 1.35 2005/10/15 08:39:30 lsmith Exp $ // /** @@ -330,7 +330,7 @@ $this->db_object->setOption('seqcol_name', 'id'); $this->db_object->setOption('result_wrap_class', 'DB_result'); $this->phptype = $this->db_object->phptype; - $this->connection = $this->db_object->connection; + $this->connection = $this->db_object->getConnection(); $this->dsn = $this->db_object->getDSN(); }
http://cvs.php.net/diff.php/pear/MDB2/MDB2.php?r1=1.129&r2=1.130&ty=u Index: pear/MDB2/MDB2.php diff -u pear/MDB2/MDB2.php:1.129 pear/MDB2/MDB2.php:1.130 --- pear/MDB2/MDB2.php:1.129 Fri Oct 14 18:39:02 2005 +++ pear/MDB2/MDB2.php Sat Oct 15 04:39:22 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: MDB2.php,v 1.129 2005/10/14 22:39:02 lsmith Exp $ +// $Id: MDB2.php,v 1.130 2005/10/15 08:39:22 lsmith Exp $ // /** @@ -1837,12 +1837,12 @@ $this->row_offset = $this->row_limit = 0; $query = $this->_modifyQuery($query, $isManip, $limit, $offset); - $connected = $this->connect(); - if (PEAR::isError($connected)) { - return $connected; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $result = $this->_doQuery($query, $isManip, $this->connection, false); + $result = $this->_doQuery($query, $isManip, $connection, false); if (PEAR::isError($result)) { return $result; } @@ -1912,12 +1912,12 @@ $this->row_offset = $this->row_limit = 0; $query = $this->_modifyQuery($query, $isManip, $limit, $offset); - $connected = $this->connect(); - if (PEAR::isError($connected)) { - return $connected; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $result = $this->_doQuery($query, $isManip, $this->connection, $this->database_name); + $result = $this->_doQuery($query, $isManip, $connection, $this->database_name); if (PEAR::isError($result)) { return $result; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/fbsql.php?r1=1.72&r2=1.73&ty=u Index: pear/MDB2/MDB2/Driver/fbsql.php diff -u pear/MDB2/MDB2/Driver/fbsql.php:1.72 pear/MDB2/MDB2/Driver/fbsql.php:1.73 --- pear/MDB2/MDB2/Driver/fbsql.php:1.72 Thu Oct 6 05:37:13 2005 +++ pear/MDB2/MDB2/Driver/fbsql.php Sat Oct 15 04:39:26 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.72 2005/10/06 09:37:13 lsmith Exp $ +// $Id: fbsql.php,v 1.73 2005/10/15 08:39:26 lsmith Exp $ // /** @@ -314,11 +314,10 @@ } if (is_null($connection)) { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $connection = $this->connection; } if (is_null($database_name)) { $database_name = $this->database_name; @@ -431,7 +430,11 @@ */ function lastInsertID($table = null, $field = null) { - $value = @fbsql_insert_id($this->connection); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + $value = @fbsql_insert_id($connection); if (!$value) { return $this->raiseError(); } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/ibase.php?r1=1.107&r2=1.108&ty=u Index: pear/MDB2/MDB2/Driver/ibase.php diff -u pear/MDB2/MDB2/Driver/ibase.php:1.107 pear/MDB2/MDB2/Driver/ibase.php:1.108 --- pear/MDB2/MDB2/Driver/ibase.php:1.107 Fri Oct 14 17:59:52 2005 +++ pear/MDB2/MDB2/Driver/ibase.php Sat Oct 15 04:39:26 2005 @@ -43,7 +43,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.107 2005/10/14 21:59:52 quipo Exp $ +// $Id: ibase.php,v 1.108 2005/10/15 08:39:26 lsmith Exp $ /** * MDB2 FireBird/InterBase driver @@ -219,11 +219,14 @@ */ function &getConnection() { + if ($this->in_transaction) { + return $this->transaction_id; + } $result = $this->connect(); if (PEAR::isError($result)) { return $result; } - return $this->in_transaction ? $this->transaction_id : $this->connection; + return $this->connection; } // }}} @@ -453,14 +456,9 @@ } if (is_null($connection)) { - if ($this->in_transaction) { - $connection = $this->transaction_id; - } else { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; - } - $connection = $this->connection; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } } $result = ibase_query($connection, $query); @@ -477,51 +475,6 @@ } // }}} - // {{{ query() - - /** - * Send a query to the database and return any results - * - * @param string $query the SQL query - * @param mixed $types array that contains the types of the columns in - * the result set - * @param mixed $result_class string which specifies which result class to use - * @param mixed $result_wrap_class string which specifies which class to wrap results in - * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure - * @access public - */ - function &query($query, $types = null, $result_class = true, $result_wrap_class = false) - { - $isManip = MDB2::isManip($query); - $offset = $this->row_offset; - $limit = $this->row_limit; - $this->row_offset = $this->row_limit = 0; - $query = $this->_modifyQuery($query, $isManip, $limit, $offset); - - $connected = $this->connect(); - if (PEAR::isError($connected)) { - return $connected; - } - - $connection = $this->in_transaction - ? $this->transaction_id : $this->connection; - - $result = $this->_doQuery($query, $isManip, $connection, $this->database_name); - if (PEAR::isError($result)) { - return $result; - } - - // check for integers instead of manip since drivers may do some - // custom checks not covered by MDB2::isManip() - if (is_int($result)) { - return $result; - } - - $result =& $this->_wrapResult($result, $types, $result_class, $result_wrap_class, $limit, $offset); - return $result; - } - - // }}} // {{{ _modifyQuery() /** @@ -626,7 +579,10 @@ $position = $p_position; } } - $connection = ($this->in_transaction ? $this->transaction_id : $this->connection); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } $statement = ibase_prepare($connection, $query); $class_name = 'MDB2_Statement_'.$this->phptype; @@ -1126,12 +1082,10 @@ return $null; } - $connected = $this->db->connect(); - if (PEAR::isError($connected)) { - return $connected; - } - $connection = $this->db->in_transaction - ? $this->db->transaction_id : $this->db->connection; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } $parameters = array(0 => $this->statement); $i = 0; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mssql.php?r1=1.83&r2=1.84&ty=u Index: pear/MDB2/MDB2/Driver/mssql.php diff -u pear/MDB2/MDB2/Driver/mssql.php:1.83 pear/MDB2/MDB2/Driver/mssql.php:1.84 --- pear/MDB2/MDB2/Driver/mssql.php:1.83 Mon Oct 10 08:28:12 2005 +++ pear/MDB2/MDB2/Driver/mssql.php Sat Oct 15 04:39:27 2005 @@ -43,7 +43,7 @@ // | Author: Frank M. Kromann <frank@kromann.info> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.83 2005/10/10 12:28:12 lsmith Exp $ +// $Id: mssql.php,v 1.84 2005/10/15 08:39:27 lsmith Exp $ // // {{{ Class MDB2_Driver_mssql /** @@ -289,7 +289,7 @@ if ((bool) ini_get('mssql.datetimeconvert')) { ini_set('mssql.datetimeconvert', '0'); } - @mssql_query('SET DATEFORMAT ymd', $this->connection); + @mssql_query('SET DATEFORMAT ymd', $connection); return MDB2_OK; } @@ -339,11 +339,10 @@ } if (is_null($connection)) { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $connection = $this->connection; } if (is_null($database_name)) { $database_name = $this->database_name; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mysql.php?r1=1.75&r2=1.76&ty=u Index: pear/MDB2/MDB2/Driver/mysql.php diff -u pear/MDB2/MDB2/Driver/mysql.php:1.75 pear/MDB2/MDB2/Driver/mysql.php:1.76 --- pear/MDB2/MDB2/Driver/mysql.php:1.75 Thu Oct 6 05:37:13 2005 +++ pear/MDB2/MDB2/Driver/mysql.php Sat Oct 15 04:39:27 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.75 2005/10/06 09:37:13 lsmith Exp $ +// $Id: mysql.php,v 1.76 2005/10/15 08:39:27 lsmith Exp $ // /** @@ -437,11 +437,10 @@ } if (is_null($connection)) { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $connection = $this->connection; } if (is_null($database_name)) { $database_name = $this->database_name; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mysqli.php?r1=1.40&r2=1.41&ty=u Index: pear/MDB2/MDB2/Driver/mysqli.php diff -u pear/MDB2/MDB2/Driver/mysqli.php:1.40 pear/MDB2/MDB2/Driver/mysqli.php:1.41 --- pear/MDB2/MDB2/Driver/mysqli.php:1.40 Thu Oct 6 05:37:14 2005 +++ pear/MDB2/MDB2/Driver/mysqli.php Sat Oct 15 04:39:27 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.40 2005/10/06 09:37:14 lsmith Exp $ +// $Id: mysqli.php,v 1.41 2005/10/15 08:39:27 lsmith Exp $ // /** @@ -166,7 +166,11 @@ */ function escape($text) { - return @mysqli_escape_string($this->connection, $text); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + return @mysqli_escape_string($connection, $text); } // }}} @@ -435,11 +439,10 @@ } if (is_null($connection)) { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $connection = $this->connection; } if (is_null($database_name)) { $database_name = $this->database_name; @@ -583,7 +586,11 @@ $position = $p_position; } } - $statement = @mysqli_prepare($this->connection, $query); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + $statement = @mysqli_prepare($connection, $query); $class_name = 'MDB2_Statement_'.$this->phptype; $obj =& new $class_name($this, $statement, $query, $types, $result_types); return $obj; @@ -730,7 +737,11 @@ } return $result; } - $value = @mysqli_insert_id($this->connection); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + $value = @mysqli_insert_id($connection); if (is_numeric($value)) { $query = "DELETE FROM $sequence_name WHERE ".$this->options['seqcol_name']." < $value"; $result = $this->_doQuery($query, true); @@ -754,7 +765,11 @@ */ function lastInsertID($table = null, $field = null) { - $value = @mysqli_insert_id($this->connection); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + $value = @mysqli_insert_id($connection); if (!$value) { return $this->raiseError(); } @@ -1012,9 +1027,9 @@ return $null; } - $connected = $this->db->connect(); - if (PEAR::isError($connected)) { - return $connected; + $connection = $db->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } if (!empty($this->values)) { http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/oci8.php?r1=1.93&r2=1.94&ty=u Index: pear/MDB2/MDB2/Driver/oci8.php diff -u pear/MDB2/MDB2/Driver/oci8.php:1.93 pear/MDB2/MDB2/Driver/oci8.php:1.94 --- pear/MDB2/MDB2/Driver/oci8.php:1.93 Mon Oct 10 04:22:44 2005 +++ pear/MDB2/MDB2/Driver/oci8.php Sat Oct 15 04:39:28 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.93 2005/10/10 08:22:44 lsmith Exp $ +// $Id: oci8.php,v 1.94 2005/10/15 08:39:28 lsmith Exp $ /** * MDB2 OCI8 driver @@ -189,7 +189,11 @@ 'commit: transaction changes are being auto committed'); } if ($this->uncommitedqueries) { - if (!@OCICommit($this->connection)) { + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + if (!@OCICommit($connection)) { return $this->raiseError(); } $this->uncommitedqueries = 0; @@ -216,7 +220,11 @@ 'rollback: transactions can not be rolled back when changes are auto committed'); } if ($this->uncommitedqueries) { - if (!@OCIRollback($this->connection)) { + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + if (!@OCIRollback($connection)) { return $this->raiseError(); } $this->uncommitedqueries = 0; @@ -446,11 +454,10 @@ } if (is_null($connection)) { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $connection = $this->connection; } $result = @OCIParse($connection, $query); @@ -595,7 +602,11 @@ if (is_array($types)) { $query.= $columns.$variables; } - $statement = @OCIParse($this->connection, $query); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + $statement = @OCIParse($connection, $query); if (!$statement) { $err =& $this->raiseError(MDB2_ERROR, null, null, 'Could not create statement'); @@ -1047,9 +1058,9 @@ return $null; } - $connected = $this->db->connect(); - if (PEAR::isError($connected)) { - return $connected; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } $result = MDB2_OK; @@ -1072,7 +1083,7 @@ } } $lobs[$i]['value'] = $value; - $lobs[$i]['descriptor'] = @OCINewDescriptor($this->db->connection, OCI_D_LOB); + $lobs[$i]['descriptor'] = @OCINewDescriptor($connection, OCI_D_LOB); if (!is_object($lobs[$i]['descriptor'])) { $result = $this->db->raiseError(); break; @@ -1119,7 +1130,7 @@ if (!PEAR::isError($result)) { if (!$this->db->in_transaction) { - if (!@OCICommit($this->db->connection)) { + if (!@OCICommit($connection)) { $result = $this->db->raiseError(); } } else { http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/pgsql.php?r1=1.74&r2=1.75&ty=u Index: pear/MDB2/MDB2/Driver/pgsql.php diff -u pear/MDB2/MDB2/Driver/pgsql.php:1.74 pear/MDB2/MDB2/Driver/pgsql.php:1.75 --- pear/MDB2/MDB2/Driver/pgsql.php:1.74 Thu Oct 6 05:37:15 2005 +++ pear/MDB2/MDB2/Driver/pgsql.php Sat Oct 15 04:39:28 2005 @@ -43,7 +43,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.74 2005/10/06 09:37:15 lsmith Exp $ +// $Id: pgsql.php,v 1.75 2005/10/15 08:39:28 lsmith Exp $ /** * MDB2 PostGreSQL driver @@ -451,11 +451,10 @@ } if (is_null($connection)) { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $connection = $this->connection; } $result = @pg_query($connection, $query); http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/querysim.php?r1=1.43&r2=1.44&ty=u Index: pear/MDB2/MDB2/Driver/querysim.php diff -u pear/MDB2/MDB2/Driver/querysim.php:1.43 pear/MDB2/MDB2/Driver/querysim.php:1.44 --- pear/MDB2/MDB2/Driver/querysim.php:1.43 Wed Oct 5 08:40:28 2005 +++ pear/MDB2/MDB2/Driver/querysim.php Sat Oct 15 04:39:29 2005 @@ -61,7 +61,7 @@ // | please contact Alan Richmond. | // +----------------------------------------------------------------------+ // -// $Id: querysim.php,v 1.43 2005/10/05 12:40:28 lsmith Exp $ +// $Id: querysim.php,v 1.44 2005/10/15 08:39:29 lsmith Exp $ // /* @@ -377,15 +377,19 @@ { $buffer = ''; if ($this->opened_persistent) { - while (!feof($this->connection)) { - $buffer.= fgets($this->connection, 1024); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + while (!feof($connection)) { + $buffer.= fgets($connection, 1024); } } else { - $this->connection = @fopen($this->connected_database_name, 'r'); - while (!feof($this->connection)) { - $buffer.= fgets($this->connection, 1024); + $connection = @fopen($this->connected_database_name, 'r'); + while (!feof($connection)) { + $buffer.= fgets($connection, 1024); } - $this->connection = @fclose($this->connection); + @fclose($connection); } return $buffer; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/sqlite.php?r1=1.76&r2=1.77&ty=u Index: pear/MDB2/MDB2/Driver/sqlite.php diff -u pear/MDB2/MDB2/Driver/sqlite.php:1.76 pear/MDB2/MDB2/Driver/sqlite.php:1.77 --- pear/MDB2/MDB2/Driver/sqlite.php:1.76 Thu Oct 6 05:37:15 2005 +++ pear/MDB2/MDB2/Driver/sqlite.php Sat Oct 15 04:39:29 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: sqlite.php,v 1.76 2005/10/06 09:37:15 lsmith Exp $ +// $Id: sqlite.php,v 1.77 2005/10/15 08:39:29 lsmith Exp $ // /** @@ -367,11 +367,10 @@ } if (is_null($connection)) { - $err = $this->connect(); - if (PEAR::isError($err)) { - return $err; + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } - $connection = $this->connection; } $function = $this->options['result_buffering'] @@ -568,7 +567,11 @@ } return $result; } - $value = @sqlite_last_insert_rowid($this->connection); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + $value = @sqlite_last_insert_rowid($connection); if (is_numeric($value) && PEAR::isError($this->_doQuery("DELETE FROM $sequence_name WHERE ".$this->options['seqcol_name']." < $value", true)) ) { @@ -590,7 +593,11 @@ */ function lastInsertID($table = null, $field = null) { - $value = @sqlite_last_insert_rowid($this->connection); + $connection = $this->getConnection(); + if (PEAR::isError($connection)) { + return $connection; + } + $value = @sqlite_last_insert_rowid($connection); if (!$value) { return $this->raiseError(); } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Datatype/ibase.php?r1=1.46&r2=1.47&ty=u Index: pear/MDB2/MDB2/Driver/Datatype/ibase.php diff -u pear/MDB2/MDB2/Driver/Datatype/ibase.php:1.46 pear/MDB2/MDB2/Driver/Datatype/ibase.php:1.47 --- pear/MDB2/MDB2/Driver/Datatype/ibase.php:1.46 Fri Oct 14 19:29:55 2005 +++ pear/MDB2/MDB2/Driver/Datatype/ibase.php Sat Oct 15 04:39:30 2005 @@ -44,7 +44,7 @@ // | Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.46 2005/10/14 23:29:55 quipo Exp $ +// $Id: ibase.php,v 1.47 2005/10/15 08:39:30 lsmith Exp $ require_once 'MDB2/Driver/Datatype/Common.php'; @@ -215,9 +215,11 @@ return $db; } - if (PEAR::isError($connect = $db->connect())) { - return $connect; + $connection = $db->getConnection(); + if (PEAR::isError($connection)) { + return $connection; } + $close = true; if (is_resource($value)) { $close = false; @@ -232,15 +234,7 @@ @rewind($fp); $value = $fp; } - if ($db->in_transaction) { - $blob_id = @ibase_blob_import($db->transaction_id, $value); - } else { - $connection = $db->getConnection(); - if (PEAR::isError($connection)) { - return $connection; - } - $blob_id = @ibase_blob_import($connection, $value); - } + $blob_id = @ibase_blob_import($db->transaction_id, $value); if ($close) { @fclose($value); } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Manager/pgsql.php?r1=1.36&r2=1.37&ty=u Index: pear/MDB2/MDB2/Driver/Manager/pgsql.php diff -u pear/MDB2/MDB2/Driver/Manager/pgsql.php:1.36 pear/MDB2/MDB2/Driver/Manager/pgsql.php:1.37 --- pear/MDB2/MDB2/Driver/Manager/pgsql.php:1.36 Fri Oct 14 18:33:05 2005 +++ pear/MDB2/MDB2/Driver/Manager/pgsql.php Sat Oct 15 04:39:30 2005 @@ -42,7 +42,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.36 2005/10/14 22:33:05 lsmith Exp $ +// $Id: pgsql.php,v 1.37 2005/10/15 08:39:30 lsmith Exp $ require_once 'MDB2/Driver/Manager/Common.php'; @@ -472,7 +472,7 @@ } $subquery = "SELECT indexrelid FROM pg_index, pg_class"; - $subquery.= " WHERE (pg_class.relname='$table') AND (pg_class.oid=pg_index.indrelid)"; + $subquery.= " WHERE pg_class.relname='$table' AND pg_class.oid=pg_index.indrelid AND indisprimary != 't'"; $result = $db->queryCol("SELECT relname FROM pg_class WHERE oid IN ($subquery)"); if (PEAR::isError($result)) { return $result; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Wrapper/peardb.php?r1=1.34&r2=1.35&ty=u Index: pear/MDB2/MDB2/Wrapper/peardb.php diff -u pear/MDB2/MDB2/Wrapper/peardb.php:1.34 pear/MDB2/MDB2/Wrapper/peardb.php:1.35 --- pear/MDB2/MDB2/Wrapper/peardb.php:1.34 Mon Sep 26 10:42:01 2005 +++ pear/MDB2/MDB2/Wrapper/peardb.php Sat Oct 15 04:39:30 2005 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: peardb.php,v 1.34 2005/09/26 14:42:01 lsmith Exp $ +// $Id: peardb.php,v 1.35 2005/10/15 08:39:30 lsmith Exp $ // /** @@ -330,7 +330,7 @@ $this->db_object->setOption('seqcol_name', 'id'); $this->db_object->setOption('result_wrap_class', 'DB_result'); $this->phptype = $this->db_object->phptype; - $this->connection = $this->db_object->connection; + $this->connection = $this->db_object->getConnection(); $this->dsn = $this->db_object->getDSN(); }