cvs: pear /MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php querysim.php /MDB2/MDB2/Driver/Reverse oci8.php
| From: | Lukas Smith | Date: | Sat, 25 Mar 2006 10:39:02 +0000 |
| Subject: | cvs: pear /MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php querysim.php /MDB2/MDB2/Driver/Reverse oci8.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-39307@lists.php.net to get a copy of this message | ||
lsmith Sat Mar 25 10:39:02 2006 UTC
Modified files:
/pear/MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php
mysqli.php oci8.php pgsql.php querysim.php
/pear/MDB2/MDB2/Driver/Reverse oci8.php
Log:
- use connected_server_info in getServerVersion() as a cache cache
- use parent::disconnect() in disconnect()
http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/fbsql.php?r1=1.91&r2=1.92&diff_format=u Index: pear/MDB2/MDB2/Driver/fbsql.php diff -u pear/MDB2/MDB2/Driver/fbsql.php:1.91 pear/MDB2/MDB2/Driver/fbsql.php:1.92 --- pear/MDB2/MDB2/Driver/fbsql.php:1.91 Fri Mar 17 08:47:21 2006 +++ pear/MDB2/MDB2/Driver/fbsql.php Sat Mar 25 10:39:02 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.91 2006/03/17 08:47:21 lsmith Exp $ +// $Id: fbsql.php,v 1.92 2006/03/25 10:39:02 lsmith Exp $ // /** @@ -294,9 +294,8 @@ if (!$this->opened_persistent || $force) { @fbsql_close($this->connection); } - $this->connection = 0; - $this->in_transaction = false; } + return parent::disconnect($force); return MDB2_OK; } http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/ibase.php?r1=1.146&r2=1.147&diff_format=u Index: pear/MDB2/MDB2/Driver/ibase.php diff -u pear/MDB2/MDB2/Driver/ibase.php:1.146 pear/MDB2/MDB2/Driver/ibase.php:1.147 --- pear/MDB2/MDB2/Driver/ibase.php:1.146 Thu Mar 23 12:35:35 2006 +++ pear/MDB2/MDB2/Driver/ibase.php Sat Mar 25 10:39:02 2006 @@ -43,7 +43,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.146 2006/03/23 12:35:35 lsmith Exp $ +// $Id: ibase.php,v 1.147 2006/03/25 10:39:02 lsmith Exp $ /** * MDB2 FireBird/InterBase driver @@ -459,13 +459,11 @@ if ($this->in_transaction) { $this->rollback(); } - if ($force || !$this->opened_persistent) { + if (!$this->opened_persistent || $force) { @ibase_close($this->connection); } - $this->connection = 0; - $this->in_transaction = false; } - return MDB2_OK; + return parent::disconnect($force); } // }}} @@ -563,7 +561,9 @@ function getServerVersion($native = false) { $server_info = false; - if ($this->options['server_version']) { + if ($this->connected_server_info) { + $server_info = $this->connected_server_info; + } elseif ($this->options['server_version']) { $server_info = $this->options['server_version']; } elseif ($this->options['DBA_username']) { $ibserv = @ibase_service_attach($this->dsn['hostspec'], $this->options['DBA_username'], $this->options['DBA_password']); @@ -573,7 +573,9 @@ if (!$server_info) { return $this->raiseError(MDB2_ERROR_UNSUPPORTED, null, null, 'getServerVersion: Requires either "server_version" or "DBA_username"/"DBA_password" option'); - } + } + // cache server_info + $this->connected_server_info = $server_info; if (!$native) { //WI-V1.5.3.4854 Firebird 1.5 if (!preg_match('/-V([\d\.]*)/', $server_info, $matches)) { http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/mssql.php?r1=1.105&r2=1.106&diff_format=u Index: pear/MDB2/MDB2/Driver/mssql.php diff -u pear/MDB2/MDB2/Driver/mssql.php:1.105 pear/MDB2/MDB2/Driver/mssql.php:1.106 --- pear/MDB2/MDB2/Driver/mssql.php:1.105 Fri Mar 17 08:47:21 2006 +++ pear/MDB2/MDB2/Driver/mssql.php Sat Mar 25 10:39:02 2006 @@ -43,7 +43,7 @@ // | Author: Frank M. Kromann <frank@kromann.info> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.105 2006/03/17 08:47:21 lsmith Exp $ +// $Id: mssql.php,v 1.106 2006/03/25 10:39:02 lsmith Exp $ // // {{{ Class MDB2_Driver_mssql /** @@ -321,10 +321,8 @@ if (!$this->opened_persistent || $force) { @mssql_close($this->connection); } - $this->connection = 0; - $this->in_transaction = false; } - return MDB2_OK; + return parent::disconnect($force); } // }}} http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/mysql.php?r1=1.101&r2=1.102&diff_format=u Index: pear/MDB2/MDB2/Driver/mysql.php diff -u pear/MDB2/MDB2/Driver/mysql.php:1.101 pear/MDB2/MDB2/Driver/mysql.php:1.102 --- pear/MDB2/MDB2/Driver/mysql.php:1.101 Fri Mar 17 08:47:21 2006 +++ pear/MDB2/MDB2/Driver/mysql.php Sat Mar 25 10:39:02 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.101 2006/03/17 08:47:21 lsmith Exp $ +// $Id: mysql.php,v 1.102 2006/03/25 10:39:02 lsmith Exp $ // /** @@ -436,10 +436,8 @@ if (!$this->opened_persistent || $force) { @mysql_close($this->connection); } - $this->connection = 0; - $this->in_transaction = false; } - return MDB2_OK; + return parent::disconnect($force); } // }}} @@ -571,7 +569,16 @@ if (PEAR::isError($connection)) { return $connection; } - $server_info = @mysql_get_server_info($connection); + if ($this->connected_server_info) { + $server_info = $this->connected_server_info; + } else { + $server_info = @mysql_get_server_info($connection); + } + if (!$server_info) { + return $this->raiseError(); + } + // cache server_info + $this->connected_server_info = $server_info; if (!$native) { $tmp = explode('.', $server_info, 3); if (isset($tmp[2]) && strpos($tmp[2], '-')) { http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/mysqli.php?r1=1.80&r2=1.81&diff_format=u Index: pear/MDB2/MDB2/Driver/mysqli.php diff -u pear/MDB2/MDB2/Driver/mysqli.php:1.80 pear/MDB2/MDB2/Driver/mysqli.php:1.81 --- pear/MDB2/MDB2/Driver/mysqli.php:1.80 Fri Mar 17 08:47:21 2006 +++ pear/MDB2/MDB2/Driver/mysqli.php Sat Mar 25 10:39:02 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.80 2006/03/17 08:47:21 lsmith Exp $ +// $Id: mysqli.php,v 1.81 2006/03/25 10:39:02 lsmith Exp $ // /** @@ -433,10 +433,8 @@ if ($force) { @mysqli_close($this->connection); } - $this->connection = 0; - $this->in_transaction = false; } - return MDB2_OK; + return parent::disconnect($force); } // }}} @@ -570,7 +568,16 @@ if (PEAR::isError($connection)) { return $connection; } - $server_info = @mysqli_get_server_info($connection); + if ($this->connected_server_info) { + $server_info = $this->connected_server_info; + } else { + $server_info = @mysqli_get_server_info($connection); + } + if (!$server_info) { + return $this->raiseError(); + } + // cache server_info + $this->connected_server_info = $server_info; if (!$native) { $tmp = explode('.', $server_info, 3); if (isset($tmp[2]) && strpos($tmp[2], '-')) { http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/oci8.php?r1=1.125&r2=1.126&diff_format=u Index: pear/MDB2/MDB2/Driver/oci8.php diff -u pear/MDB2/MDB2/Driver/oci8.php:1.125 pear/MDB2/MDB2/Driver/oci8.php:1.126 --- pear/MDB2/MDB2/Driver/oci8.php:1.125 Mon Mar 20 12:57:21 2006 +++ pear/MDB2/MDB2/Driver/oci8.php Sat Mar 25 10:39:02 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.125 2006/03/20 12:57:21 lsmith Exp $ +// $Id: oci8.php,v 1.126 2006/03/25 10:39:02 lsmith Exp $ /** * MDB2 OCI8 driver @@ -369,11 +369,9 @@ @OCILogOff($this->connection); } } - $this->connection = 0; - $this->in_transaction = false; $this->uncommitedqueries = 0; } - return MDB2_OK; + return parent::disconnect($force); } // }}} @@ -568,7 +566,16 @@ if (PEAR::isError($connection)) { return $connection; } - $server_info = ociserverversion($connection); + if ($this->connected_server_info) { + $server_info = $this->connected_server_info; + } else { + $server_info = @ociserverversion($connection); + } + if (!$server_info) { + return $this->raiseError(); + } + // cache server_info + $this->connected_server_info = $server_info; if (!$native) { if (!preg_match('/ (\d+)\.(\d+)\.(\d+)\.([\d\.]+) /', $server_info, $tmp)) { return $this->raiseError(MDB2_ERROR, null, null, http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/pgsql.php?r1=1.105&r2=1.106&diff_format=u Index: pear/MDB2/MDB2/Driver/pgsql.php diff -u pear/MDB2/MDB2/Driver/pgsql.php:1.105 pear/MDB2/MDB2/Driver/pgsql.php:1.106 --- pear/MDB2/MDB2/Driver/pgsql.php:1.105 Mon Mar 20 17:04:06 2006 +++ pear/MDB2/MDB2/Driver/pgsql.php Sat Mar 25 10:39:02 2006 @@ -43,7 +43,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.105 2006/03/20 17:04:06 lsmith Exp $ +// $Id: pgsql.php,v 1.106 2006/03/25 10:39:02 lsmith Exp $ /** * MDB2 PostGreSQL driver @@ -398,10 +398,8 @@ if (!$this->opened_persistent || $force) { @pg_close($this->connection); } - $this->connection = 0; - $this->in_transaction = false; } - return MDB2_OK; + return parent::disconnect($force); } // }}} @@ -559,7 +557,16 @@ function getServerVersion($native = false) { $query = 'SHOW SERVER_VERSION'; - $server_info = $this->queryOne($query, 'text'); + if ($this->connected_server_info) { + $server_info = $this->connected_server_info; + } else { + $server_info = $this->queryOne($query, 'text'); + if (PEAR::isError($server_info)) { + return $server_info; + } + } + // cache server_info + $this->connected_server_info = $server_info; if (!$native && !PEAR::isError($server_info)) { $tmp = explode('.', $server_info, 3); if (!array_key_exists(2, $tmp) http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/querysim.php?r1=1.55&r2=1.56&diff_format=u Index: pear/MDB2/MDB2/Driver/querysim.php diff -u pear/MDB2/MDB2/Driver/querysim.php:1.55 pear/MDB2/MDB2/Driver/querysim.php:1.56 --- pear/MDB2/MDB2/Driver/querysim.php:1.55 Fri Mar 17 08:47:21 2006 +++ pear/MDB2/MDB2/Driver/querysim.php Sat Mar 25 10:39:02 2006 @@ -61,7 +61,7 @@ // | please contact Alan Richmond. | // +----------------------------------------------------------------------+ // -// $Id: querysim.php,v 1.55 2006/03/17 08:47:21 lsmith Exp $ +// $Id: querysim.php,v 1.56 2006/03/25 10:39:02 lsmith Exp $ // /* @@ -318,9 +318,8 @@ if ($this->opened_persistent) { @fclose($this->connection); } - $this->connection = 0; } - return MDB2_OK; + return parent::disconnect($force); } // }}} @@ -548,6 +547,8 @@ function getServerVersion($native = false) { $server_info = '@package_version@'; + // cache server_info + $this->connected_server_info = $server_info; if (!$native) { $tmp = explode('.', $server_info, 3); if (!isset($tmp[2]) || !preg_match('/(\d+)(.*)/', $tmp[2], $tmp2)) { http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/Reverse/oci8.php?r1=1.23&r2=1.24&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/oci8.php diff -u pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.23 pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.24 --- pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.23 Thu Mar 23 12:30:34 2006 +++ pear/MDB2/MDB2/Driver/Reverse/oci8.php Sat Mar 25 10:39:02 2006 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: oci8.php,v 1.23 2006/03/23 12:30:34 lsmith Exp $ +// $Id: oci8.php,v 1.24 2006/03/25 10:39:02 lsmith Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -356,7 +356,9 @@ */ $query = 'SELECT column_name, data_type, data_length, nullable'; $query.= ' FROM user_tab_columns'; - $query.= ' WHERE table_name='.$db->quote(strtoupper($result), 'text').' ORDER BY column_id'; + $query.= ' WHERE table_name='.$db->quote(strtoupper($result), 'text'); + $query.= ' OR table_name='.$db->quote($result, 'text'); + $query.= ' ORDER BY column_id'; $stmt = $db->_doQuery($query, false); if (PEAR::isError($stmt)) {
http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/fbsql.php?r1=1.91&r2=1.92&diff_format=u Index: pear/MDB2/MDB2/Driver/fbsql.php diff -u pear/MDB2/MDB2/Driver/fbsql.php:1.91 pear/MDB2/MDB2/Driver/fbsql.php:1.92 --- pear/MDB2/MDB2/Driver/fbsql.php:1.91 Fri Mar 17 08:47:21 2006 +++ pear/MDB2/MDB2/Driver/fbsql.php Sat Mar 25 10:39:02 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.91 2006/03/17 08:47:21 lsmith Exp $ +// $Id: fbsql.php,v 1.92 2006/03/25 10:39:02 lsmith Exp $ // /** @@ -294,9 +294,8 @@ if (!$this->opened_persistent || $force) { @fbsql_close($this->connection); } - $this->connection = 0; - $this->in_transaction = false; } + return parent::disconnect($force); return MDB2_OK; } http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/ibase.php?r1=1.146&r2=1.147&diff_format=u Index: pear/MDB2/MDB2/Driver/ibase.php diff -u pear/MDB2/MDB2/Driver/ibase.php:1.146 pear/MDB2/MDB2/Driver/ibase.php:1.147 --- pear/MDB2/MDB2/Driver/ibase.php:1.146 Thu Mar 23 12:35:35 2006 +++ pear/MDB2/MDB2/Driver/ibase.php Sat Mar 25 10:39:02 2006 @@ -43,7 +43,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.146 2006/03/23 12:35:35 lsmith Exp $ +// $Id: ibase.php,v 1.147 2006/03/25 10:39:02 lsmith Exp $ /** * MDB2 FireBird/InterBase driver @@ -459,13 +459,11 @@ if ($this->in_transaction) { $this->rollback(); } - if ($force || !$this->opened_persistent) { + if (!$this->opened_persistent || $force) { @ibase_close($this->connection); } - $this->connection = 0; - $this->in_transaction = false; } - return MDB2_OK; + return parent::disconnect($force); } // }}} @@ -563,7 +561,9 @@ function getServerVersion($native = false) { $server_info = false; - if ($this->options['server_version']) { + if ($this->connected_server_info) { + $server_info = $this->connected_server_info; + } elseif ($this->options['server_version']) { $server_info = $this->options['server_version']; } elseif ($this->options['DBA_username']) { $ibserv = @ibase_service_attach($this->dsn['hostspec'], $this->options['DBA_username'], $this->options['DBA_password']); @@ -573,7 +573,9 @@ if (!$server_info) { return $this->raiseError(MDB2_ERROR_UNSUPPORTED, null, null, 'getServerVersion: Requires either "server_version" or "DBA_username"/"DBA_password" option'); - } + } + // cache server_info + $this->connected_server_info = $server_info; if (!$native) { //WI-V1.5.3.4854 Firebird 1.5 if (!preg_match('/-V([\d\.]*)/', $server_info, $matches)) { http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/mssql.php?r1=1.105&r2=1.106&diff_format=u Index: pear/MDB2/MDB2/Driver/mssql.php diff -u pear/MDB2/MDB2/Driver/mssql.php:1.105 pear/MDB2/MDB2/Driver/mssql.php:1.106 --- pear/MDB2/MDB2/Driver/mssql.php:1.105 Fri Mar 17 08:47:21 2006 +++ pear/MDB2/MDB2/Driver/mssql.php Sat Mar 25 10:39:02 2006 @@ -43,7 +43,7 @@ // | Author: Frank M. Kromann <frank@kromann.info> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.105 2006/03/17 08:47:21 lsmith Exp $ +// $Id: mssql.php,v 1.106 2006/03/25 10:39:02 lsmith Exp $ // // {{{ Class MDB2_Driver_mssql /** @@ -321,10 +321,8 @@ if (!$this->opened_persistent || $force) { @mssql_close($this->connection); } - $this->connection = 0; - $this->in_transaction = false; } - return MDB2_OK; + return parent::disconnect($force); } // }}} http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/mysql.php?r1=1.101&r2=1.102&diff_format=u Index: pear/MDB2/MDB2/Driver/mysql.php diff -u pear/MDB2/MDB2/Driver/mysql.php:1.101 pear/MDB2/MDB2/Driver/mysql.php:1.102 --- pear/MDB2/MDB2/Driver/mysql.php:1.101 Fri Mar 17 08:47:21 2006 +++ pear/MDB2/MDB2/Driver/mysql.php Sat Mar 25 10:39:02 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.101 2006/03/17 08:47:21 lsmith Exp $ +// $Id: mysql.php,v 1.102 2006/03/25 10:39:02 lsmith Exp $ // /** @@ -436,10 +436,8 @@ if (!$this->opened_persistent || $force) { @mysql_close($this->connection); } - $this->connection = 0; - $this->in_transaction = false; } - return MDB2_OK; + return parent::disconnect($force); } // }}} @@ -571,7 +569,16 @@ if (PEAR::isError($connection)) { return $connection; } - $server_info = @mysql_get_server_info($connection); + if ($this->connected_server_info) { + $server_info = $this->connected_server_info; + } else { + $server_info = @mysql_get_server_info($connection); + } + if (!$server_info) { + return $this->raiseError(); + } + // cache server_info + $this->connected_server_info = $server_info; if (!$native) { $tmp = explode('.', $server_info, 3); if (isset($tmp[2]) && strpos($tmp[2], '-')) { http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/mysqli.php?r1=1.80&r2=1.81&diff_format=u Index: pear/MDB2/MDB2/Driver/mysqli.php diff -u pear/MDB2/MDB2/Driver/mysqli.php:1.80 pear/MDB2/MDB2/Driver/mysqli.php:1.81 --- pear/MDB2/MDB2/Driver/mysqli.php:1.80 Fri Mar 17 08:47:21 2006 +++ pear/MDB2/MDB2/Driver/mysqli.php Sat Mar 25 10:39:02 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.80 2006/03/17 08:47:21 lsmith Exp $ +// $Id: mysqli.php,v 1.81 2006/03/25 10:39:02 lsmith Exp $ // /** @@ -433,10 +433,8 @@ if ($force) { @mysqli_close($this->connection); } - $this->connection = 0; - $this->in_transaction = false; } - return MDB2_OK; + return parent::disconnect($force); } // }}} @@ -570,7 +568,16 @@ if (PEAR::isError($connection)) { return $connection; } - $server_info = @mysqli_get_server_info($connection); + if ($this->connected_server_info) { + $server_info = $this->connected_server_info; + } else { + $server_info = @mysqli_get_server_info($connection); + } + if (!$server_info) { + return $this->raiseError(); + } + // cache server_info + $this->connected_server_info = $server_info; if (!$native) { $tmp = explode('.', $server_info, 3); if (isset($tmp[2]) && strpos($tmp[2], '-')) { http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/oci8.php?r1=1.125&r2=1.126&diff_format=u Index: pear/MDB2/MDB2/Driver/oci8.php diff -u pear/MDB2/MDB2/Driver/oci8.php:1.125 pear/MDB2/MDB2/Driver/oci8.php:1.126 --- pear/MDB2/MDB2/Driver/oci8.php:1.125 Mon Mar 20 12:57:21 2006 +++ pear/MDB2/MDB2/Driver/oci8.php Sat Mar 25 10:39:02 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.125 2006/03/20 12:57:21 lsmith Exp $ +// $Id: oci8.php,v 1.126 2006/03/25 10:39:02 lsmith Exp $ /** * MDB2 OCI8 driver @@ -369,11 +369,9 @@ @OCILogOff($this->connection); } } - $this->connection = 0; - $this->in_transaction = false; $this->uncommitedqueries = 0; } - return MDB2_OK; + return parent::disconnect($force); } // }}} @@ -568,7 +566,16 @@ if (PEAR::isError($connection)) { return $connection; } - $server_info = ociserverversion($connection); + if ($this->connected_server_info) { + $server_info = $this->connected_server_info; + } else { + $server_info = @ociserverversion($connection); + } + if (!$server_info) { + return $this->raiseError(); + } + // cache server_info + $this->connected_server_info = $server_info; if (!$native) { if (!preg_match('/ (\d+)\.(\d+)\.(\d+)\.([\d\.]+) /', $server_info, $tmp)) { return $this->raiseError(MDB2_ERROR, null, null, http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/pgsql.php?r1=1.105&r2=1.106&diff_format=u Index: pear/MDB2/MDB2/Driver/pgsql.php diff -u pear/MDB2/MDB2/Driver/pgsql.php:1.105 pear/MDB2/MDB2/Driver/pgsql.php:1.106 --- pear/MDB2/MDB2/Driver/pgsql.php:1.105 Mon Mar 20 17:04:06 2006 +++ pear/MDB2/MDB2/Driver/pgsql.php Sat Mar 25 10:39:02 2006 @@ -43,7 +43,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.105 2006/03/20 17:04:06 lsmith Exp $ +// $Id: pgsql.php,v 1.106 2006/03/25 10:39:02 lsmith Exp $ /** * MDB2 PostGreSQL driver @@ -398,10 +398,8 @@ if (!$this->opened_persistent || $force) { @pg_close($this->connection); } - $this->connection = 0; - $this->in_transaction = false; } - return MDB2_OK; + return parent::disconnect($force); } // }}} @@ -559,7 +557,16 @@ function getServerVersion($native = false) { $query = 'SHOW SERVER_VERSION'; - $server_info = $this->queryOne($query, 'text'); + if ($this->connected_server_info) { + $server_info = $this->connected_server_info; + } else { + $server_info = $this->queryOne($query, 'text'); + if (PEAR::isError($server_info)) { + return $server_info; + } + } + // cache server_info + $this->connected_server_info = $server_info; if (!$native && !PEAR::isError($server_info)) { $tmp = explode('.', $server_info, 3); if (!array_key_exists(2, $tmp) http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/querysim.php?r1=1.55&r2=1.56&diff_format=u Index: pear/MDB2/MDB2/Driver/querysim.php diff -u pear/MDB2/MDB2/Driver/querysim.php:1.55 pear/MDB2/MDB2/Driver/querysim.php:1.56 --- pear/MDB2/MDB2/Driver/querysim.php:1.55 Fri Mar 17 08:47:21 2006 +++ pear/MDB2/MDB2/Driver/querysim.php Sat Mar 25 10:39:02 2006 @@ -61,7 +61,7 @@ // | please contact Alan Richmond. | // +----------------------------------------------------------------------+ // -// $Id: querysim.php,v 1.55 2006/03/17 08:47:21 lsmith Exp $ +// $Id: querysim.php,v 1.56 2006/03/25 10:39:02 lsmith Exp $ // /* @@ -318,9 +318,8 @@ if ($this->opened_persistent) { @fclose($this->connection); } - $this->connection = 0; } - return MDB2_OK; + return parent::disconnect($force); } // }}} @@ -548,6 +547,8 @@ function getServerVersion($native = false) { $server_info = '@package_version@'; + // cache server_info + $this->connected_server_info = $server_info; if (!$native) { $tmp = explode('.', $server_info, 3); if (!isset($tmp[2]) || !preg_match('/(\d+)(.*)/', $tmp[2], $tmp2)) { http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/Reverse/oci8.php?r1=1.23&r2=1.24&diff_format=u Index: pear/MDB2/MDB2/Driver/Reverse/oci8.php diff -u pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.23 pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.24 --- pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.23 Thu Mar 23 12:30:34 2006 +++ pear/MDB2/MDB2/Driver/Reverse/oci8.php Sat Mar 25 10:39:02 2006 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: oci8.php,v 1.23 2006/03/23 12:30:34 lsmith Exp $ +// $Id: oci8.php,v 1.24 2006/03/25 10:39:02 lsmith Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -356,7 +356,9 @@ */ $query = 'SELECT column_name, data_type, data_length, nullable'; $query.= ' FROM user_tab_columns'; - $query.= ' WHERE table_name='.$db->quote(strtoupper($result), 'text').' ORDER BY column_id'; + $query.= ' WHERE table_name='.$db->quote(strtoupper($result), 'text'); + $query.= ' OR table_name='.$db->quote($result, 'text'); + $query.= ' ORDER BY column_id'; $stmt = $db->_doQuery($query, false); if (PEAR::isError($stmt)) {