cvs: pear /MDB2 MDB2.php package.php package_fbsql.php package_ibase.php package_mssql.php package_mysql.php package_mysqli.php package_oci8.php
package_pgsql.php package_sqlite.php /MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php sqlite.php

From: Date: Sun, 23 Sep 2007 17:24:32 +0000
Subject: cvs: pear /MDB2 MDB2.php package.php package_fbsql.php package_ibase.php package_mssql.php package_mysql.php package_mysqli.php package_oci8.php
package_pgsql.php package_sqlite.php /MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php sqlite.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-48650@lists.php.net to get a copy of this message
quipo Sun Sep 23 17:24:32 2007 UTC Modified files: /pear/MDB2 MDB2.php package.php package_fbsql.php package_ibase.php package_mssql.php package_mysql.php package_mysqli.php package_oci8.php package_pgsql.php package_sqlite.php /pear/MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php mysqli.php oci8.php pgsql.php sqlite.php Log: fixed bug #11790: avoid array_diff() because it has a memory leak in PHP 5.1.x

http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2.php?r1=1.296&r2=1.297&diff_format=u Index: pear/MDB2/MDB2.php diff -u pear/MDB2/MDB2.php:1.296 pear/MDB2/MDB2.php:1.297 --- pear/MDB2/MDB2.php:1.296 Sun Sep 9 14:10:29 2007 +++ pear/MDB2/MDB2.php Sun Sep 23 17:24:31 2007 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: MDB2.php,v 1.296 2007/09/09 14:10:29 quipo Exp $ +// $Id: MDB2.php,v 1.297 2007/09/23 17:24:31 quipo Exp $ // /** @@ -502,6 +502,31 @@ } // }}} + // {{{ function areEquals() + + /** + * It looks like there's a memory leak in array_diff() in PHP 5.1.x, + * so use this method instead. + * @see http://pear.php.net/bugs/bug.php?id=11790 + * + * @param array $arr1 + * @param array $arr2 + * @return boolean + */ + function areEquals($arr1, $arr2) + { + if (count($arr1) != count($arr2)) { + return false; + } + foreach (array_keys($arr1) as $k) { + if (!array_key_exists($k, $arr2) || $arr1[$k] != $arr2[$k]) { + return false; + } + } + return true; + } + + // }}} // {{{ function loadFile($file) /** @@ -1868,7 +1893,7 @@ return $err; } - // load modul in a specific version + // load module in a specific version if ($version) { if (method_exists($class_name, 'getClassName')) { $class_name_new = call_user_func(array($class_name, 'getClassName'), $this->db_index); http://cvs.php.net/viewvc.cgi/pear/MDB2/package.php?r1=1.264&r2=1.265&diff_format=u Index: pear/MDB2/package.php diff -u pear/MDB2/package.php:1.264 pear/MDB2/package.php:1.265 --- pear/MDB2/package.php:1.264 Wed Sep 19 20:54:47 2007 +++ pear/MDB2/package.php Sun Sep 23 17:24:32 2007 @@ -14,6 +14,7 @@ - fixed bug #11428: propagate quote() errors with invalid data types - added new test cases in the test suite - added LENGTH() function in the Function module +- fixed bug #11790: avoid array_diff() because it has a memory leak in PHP 5.1.x - fixed bug #11906: quoteIdentifier fails for names with dots - fixed bug #11975: Extended::autoExecute() does not work with Oracle when using LOBs (patch by Pieter Meulen, van der) http://cvs.php.net/viewvc.cgi/pear/MDB2/package_fbsql.php?r1=1.53&r2=1.54&diff_format=u Index: pear/MDB2/package_fbsql.php diff -u pear/MDB2/package_fbsql.php:1.53 pear/MDB2/package_fbsql.php:1.54 --- pear/MDB2/package_fbsql.php:1.53 Sat Mar 10 13:38:26 2007 +++ pear/MDB2/package_fbsql.php Sun Sep 23 17:24:32 2007 @@ -41,6 +41,7 @@ because this prevents lastInsertID() from working - migrated to package.xml version 2 - added _mapNativeDatatype() in the Datatype module +- fixed bug #11790: avoid array_diff() because it has a memory leak in PHP 5.1.x note: - this driver needs a serious update as it's currently unmaintained/untested http://cvs.php.net/viewvc.cgi/pear/MDB2/package_ibase.php?r1=1.127&r2=1.128&diff_format=u Index: pear/MDB2/package_ibase.php diff -u pear/MDB2/package_ibase.php:1.127 pear/MDB2/package_ibase.php:1.128 --- pear/MDB2/package_ibase.php:1.127 Sat Jun 30 11:07:35 2007 +++ pear/MDB2/package_ibase.php Sun Sep 23 17:24:32 2007 @@ -8,6 +8,7 @@ $notes = <<<EOT - initial support for FOREIGN KEY and CHECK constraints in the Reverse and Manager modules - fixed bug #11428: propagate quote() errors with invalid data types +- fixed bug #11790: avoid array_diff() because it has a memory leak in PHP 5.1.x EOT; $description = 'This is the Interbase/Firebird MDB2 driver.'; http://cvs.php.net/viewvc.cgi/pear/MDB2/package_mssql.php?r1=1.95&r2=1.96&diff_format=u Index: pear/MDB2/package_mssql.php diff -u pear/MDB2/package_mssql.php:1.95 pear/MDB2/package_mssql.php:1.96 --- pear/MDB2/package_mssql.php:1.95 Mon Aug 13 10:43:32 2007 +++ pear/MDB2/package_mssql.php Sun Sep 23 17:24:32 2007 @@ -11,6 +11,7 @@ - request #11297: added support for "schema.table" notation in the Reverse module - request #11445: added support for unicode datatypes (nchar, nvarchar, ntext) - fixed bug #11479: wrong query in nextID() +- fixed bug #11790: avoid array_diff() because it has a memory leak in PHP 5.1.x - request #11797: don't use mssql_field_name() in listTableFields() in the Manager module since it only returns the first 30 chars http://cvs.php.net/viewvc.cgi/pear/MDB2/package_mysql.php?r1=1.121&r2=1.122&diff_format=u Index: pear/MDB2/package_mysql.php diff -u pear/MDB2/package_mysql.php:1.121 pear/MDB2/package_mysql.php:1.122 --- pear/MDB2/package_mysql.php:1.121 Fri Aug 3 22:46:35 2007 +++ pear/MDB2/package_mysql.php Sun Sep 23 17:24:32 2007 @@ -14,6 +14,7 @@ - request #11389: added many new MySQL 5.1 error codes in errorInfo() - fixed bug #11428: propagate quote() errors with invalid data types - fixed bug #11590: _getServerCapabilities() has to be called once per connection +- fixed bug #11790: avoid array_diff() because it has a memory leak in PHP 5.1.x note: - the multi_query test failes because this is not supported by ext/mysql http://cvs.php.net/viewvc.cgi/pear/MDB2/package_mysqli.php?r1=1.125&r2=1.126&diff_format=u Index: pear/MDB2/package_mysqli.php diff -u pear/MDB2/package_mysqli.php:1.125 pear/MDB2/package_mysqli.php:1.126 --- pear/MDB2/package_mysqli.php:1.125 Fri Aug 3 22:46:35 2007 +++ pear/MDB2/package_mysqli.php Sun Sep 23 17:24:32 2007 @@ -15,6 +15,7 @@ - fixed bug #11428: propagate quote() errors with invalid data types - fixed bug in _modifyQuery() when using SELECT FOR UPDATE or similar queries - fixed bug #11590: _getServerCapabilities() has to be called once per connection +- fixed bug #11790: avoid array_diff() because it has a memory leak in PHP 5.1.x open todo items: - use a trigger to emulate setting default now() http://cvs.php.net/viewvc.cgi/pear/MDB2/package_oci8.php?r1=1.129&r2=1.130&diff_format=u Index: pear/MDB2/package_oci8.php diff -u pear/MDB2/package_oci8.php:1.129 pear/MDB2/package_oci8.php:1.130 --- pear/MDB2/package_oci8.php:1.129 Sun Sep 9 13:36:11 2007 +++ pear/MDB2/package_oci8.php Sun Sep 23 17:24:32 2007 @@ -7,15 +7,16 @@ $state = 'stable'; $notes = <<<EOT - initial support for FOREIGN KEY and CHECK constraints in the Reverse and Manager modules +- fixed bug #10969: execute() does not bind reference variables (patch by Charles Woodcock) - request #11297: added support for "owner.table" notation in the Manager and Reverse modules - fixed bug #11428: propagate quote() errors with invalid data types -- fixed bug #10969: execute() does not bind reference variables (patch by Charles Woodcock) - use prepared queries in the list*() methods of the Manager module and in the Reverse module (thanks to Hugh Dixon) - add support for "owner" parameter in listViews(), listFunctions(), listTables(), listSequences() in the Manager module - added listTableTriggers() in the Manager module - do not list constraints in listTableIndexes() in the Manager module +- fixed bug #11790: avoid array_diff() because it has a memory leak in PHP 5.1.x - fixed bug #11933: avoid duplicate queries in the Reverse module and free results and prepared statement handles (thanks Jan Reitz) http://cvs.php.net/viewvc.cgi/pear/MDB2/package_pgsql.php?r1=1.123&r2=1.124&diff_format=u Index: pear/MDB2/package_pgsql.php diff -u pear/MDB2/package_pgsql.php:1.123 pear/MDB2/package_pgsql.php:1.124 --- pear/MDB2/package_pgsql.php:1.123 Sat Aug 4 08:13:32 2007 +++ pear/MDB2/package_pgsql.php Sun Sep 23 17:24:32 2007 @@ -18,6 +18,7 @@ - fixed bug #11694: remove data type cast from DEFAULT value in getTableFieldDefinition() in the Reverse module - fixed bug #11753: NOTICEs in alterTable() in the Manager module +- fixed bug #11790: avoid array_diff() because it has a memory leak in PHP 5.1.x open todo items: - enable pg_execute() once issues with bytea column are resolved http://cvs.php.net/viewvc.cgi/pear/MDB2/package_sqlite.php?r1=1.99&r2=1.100&diff_format=u Index: pear/MDB2/package_sqlite.php diff -u pear/MDB2/package_sqlite.php:1.99 pear/MDB2/package_sqlite.php:1.100 --- pear/MDB2/package_sqlite.php:1.99 Tue Aug 14 15:11:58 2007 +++ pear/MDB2/package_sqlite.php Sun Sep 23 17:24:32 2007 @@ -11,6 +11,7 @@ - in listTableConstraints() in the Reverse module, also search in table definition for PRIMARY KEYs and FOREIGN KEYs - fixed bug #11428: propagate quote() errors with invalid data types +- fixed bug #11790: avoid array_diff() because it has a memory leak in PHP 5.1.x note: open todo items: http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/fbsql.php?r1=1.130&r2=1.131&diff_format=u Index: pear/MDB2/MDB2/Driver/fbsql.php diff -u pear/MDB2/MDB2/Driver/fbsql.php:1.130 pear/MDB2/MDB2/Driver/fbsql.php:1.131 --- pear/MDB2/MDB2/Driver/fbsql.php:1.130 Tue Oct 31 18:46:43 2006 +++ pear/MDB2/MDB2/Driver/fbsql.php Sun Sep 23 17:24:32 2007 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.130 2006/10/31 18:46:43 lsmith Exp $ +// $Id: fbsql.php,v 1.131 2007/09/23 17:24:32 quipo Exp $ // /** @@ -261,7 +261,8 @@ function connect() { if (is_resource($this->connection)) { - if (count(array_diff($this->connected_dsn, $this->dsn)) == 0 + //if (count(array_diff($this->connected_dsn, $this->dsn)) == 0 + if (MDB2::areEquals($this->connected_dsn, $this->dsn) && $this->opened_persistent == $this->options['persistent'] ) { return MDB2_OK; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/ibase.php?r1=1.206&r2=1.207&diff_format=u Index: pear/MDB2/MDB2/Driver/ibase.php diff -u pear/MDB2/MDB2/Driver/ibase.php:1.206 pear/MDB2/MDB2/Driver/ibase.php:1.207 --- pear/MDB2/MDB2/Driver/ibase.php:1.206 Sat Jun 30 11:07:34 2007 +++ pear/MDB2/MDB2/Driver/ibase.php Sun Sep 23 17:24:32 2007 @@ -43,7 +43,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.206 2007/06/30 11:07:34 quipo Exp $ +// $Id: ibase.php,v 1.207 2007/09/23 17:24:32 quipo Exp $ /** * MDB2 FireBird/InterBase driver @@ -518,7 +518,8 @@ { $database_file = $this->_getDatabaseFile($this->database_name); if (is_resource($this->connection)) { - if (count(array_diff($this->connected_dsn, $this->dsn)) == 0 + //if (count(array_diff($this->connected_dsn, $this->dsn)) == 0 + if (MDB2::areEquals($this->connected_dsn, $this->dsn) && $this->connected_database_name == $database_file && $this->opened_persistent == $this->options['persistent'] ) { http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/mssql.php?r1=1.158&r2=1.159&diff_format=u Index: pear/MDB2/MDB2/Driver/mssql.php diff -u pear/MDB2/MDB2/Driver/mssql.php:1.158 pear/MDB2/MDB2/Driver/mssql.php:1.159 --- pear/MDB2/MDB2/Driver/mssql.php:1.158 Tue Jul 3 21:58:57 2007 +++ pear/MDB2/MDB2/Driver/mssql.php Sun Sep 23 17:24:32 2007 @@ -43,7 +43,7 @@ // | Author: Frank M. Kromann <frank@kromann.info> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.158 2007/07/03 21:58:57 davidc Exp $ +// $Id: mssql.php,v 1.159 2007/09/23 17:24:32 quipo Exp $ // // {{{ Class MDB2_Driver_mssql /** @@ -306,7 +306,8 @@ function connect() { if (is_resource($this->connection)) { - if (count(array_diff($this->connected_dsn, $this->dsn)) == 0 + //if (count(array_diff($this->connected_dsn, $this->dsn)) == 0 + if (MDB2::areEquals($this->connected_dsn, $this->dsn) && $this->opened_persistent == $this->options['persistent'] ) { return MDB2_OK; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/mysql.php?r1=1.189&r2=1.190&diff_format=u Index: pear/MDB2/MDB2/Driver/mysql.php diff -u pear/MDB2/MDB2/Driver/mysql.php:1.189 pear/MDB2/MDB2/Driver/mysql.php:1.190 --- pear/MDB2/MDB2/Driver/mysql.php:1.189 Sun Jul 22 13:59:22 2007 +++ pear/MDB2/MDB2/Driver/mysql.php Sun Sep 23 17:24:32 2007 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.189 2007/07/22 13:59:22 quipo Exp $ +// $Id: mysql.php,v 1.190 2007/09/23 17:24:32 quipo Exp $ // /** @@ -432,7 +432,8 @@ function connect() { if (is_resource($this->connection)) { - if (count(array_diff($this->connected_dsn, $this->dsn)) == 0 + //if (count(array_diff($this->connected_dsn, $this->dsn)) == 0 + if (MDB2::areEquals($this->connected_dsn, $this->dsn) && $this->opened_persistent == $this->options['persistent'] && $this->connected_database_name == $this->database_name ) { http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/mysqli.php?r1=1.169&r2=1.170&diff_format=u Index: pear/MDB2/MDB2/Driver/mysqli.php diff -u pear/MDB2/MDB2/Driver/mysqli.php:1.169 pear/MDB2/MDB2/Driver/mysqli.php:1.170 --- pear/MDB2/MDB2/Driver/mysqli.php:1.169 Sun Jul 22 13:59:22 2007 +++ pear/MDB2/MDB2/Driver/mysqli.php Sun Sep 23 17:24:32 2007 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.169 2007/07/22 13:59:22 quipo Exp $ +// $Id: mysqli.php,v 1.170 2007/09/23 17:24:32 quipo Exp $ // /** @@ -429,7 +429,8 @@ function connect() { if (is_object($this->connection)) { - if (count(array_diff($this->connected_dsn, $this->dsn)) == 0) { + //if (count(array_diff($this->connected_dsn, $this->dsn)) == 0) { + if (MDB2::areEquals($this->connected_dsn, $this->dsn) { return MDB2_OK; } $this->connection = 0; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/oci8.php?r1=1.197&r2=1.198&diff_format=u Index: pear/MDB2/MDB2/Driver/oci8.php diff -u pear/MDB2/MDB2/Driver/oci8.php:1.197 pear/MDB2/MDB2/Driver/oci8.php:1.198 --- pear/MDB2/MDB2/Driver/oci8.php:1.197 Thu Jul 12 20:01:53 2007 +++ pear/MDB2/MDB2/Driver/oci8.php Sun Sep 23 17:24:32 2007 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.197 2007/07/12 20:01:53 quipo Exp $ +// $Id: oci8.php,v 1.198 2007/09/23 17:24:32 quipo Exp $ /** * MDB2 OCI8 driver @@ -427,7 +427,8 @@ $this->dsn['username'] = $this->options['database_name_prefix'].$this->database_name; } if (is_resource($this->connection)) { - if (count(array_diff($this->connected_dsn, $this->dsn)) == 0 + //if (count(array_diff($this->connected_dsn, $this->dsn)) == 0 + if (MDB2::areEquals($this->connected_dsn, $this->dsn) && $this->connected_database_name == $this->database_name && $this->opened_persistent == $this->options['persistent'] ) { http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/pgsql.php?r1=1.180&r2=1.181&diff_format=u Index: pear/MDB2/MDB2/Driver/pgsql.php diff -u pear/MDB2/MDB2/Driver/pgsql.php:1.180 pear/MDB2/MDB2/Driver/pgsql.php:1.181 --- pear/MDB2/MDB2/Driver/pgsql.php:1.180 Sat Jul 21 13:35:49 2007 +++ pear/MDB2/MDB2/Driver/pgsql.php Sun Sep 23 17:24:32 2007 @@ -43,7 +43,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.180 2007/07/21 13:35:49 quipo Exp $ +// $Id: pgsql.php,v 1.181 2007/09/23 17:24:32 quipo Exp $ /** * MDB2 PostGreSQL driver @@ -452,7 +452,8 @@ function connect() { if (is_resource($this->connection)) { - if (count(array_diff($this->connected_dsn, $this->dsn)) == 0 + //if (count(array_diff($this->connected_dsn, $this->dsn)) == 0 + if (MDB2::areEquals($this->connected_dsn, $this->dsn) && $this->connected_database_name == $this->database_name && ($this->opened_persistent == $this->options['persistent']) ) { http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/sqlite.php?r1=1.150&r2=1.151&diff_format=u Index: pear/MDB2/MDB2/Driver/sqlite.php diff -u pear/MDB2/MDB2/Driver/sqlite.php:1.150 pear/MDB2/MDB2/Driver/sqlite.php:1.151 --- pear/MDB2/MDB2/Driver/sqlite.php:1.150 Sat Jun 30 11:07:35 2007 +++ pear/MDB2/MDB2/Driver/sqlite.php Sun Sep 23 17:24:32 2007 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: sqlite.php,v 1.150 2007/06/30 11:07:35 quipo Exp $ +// $Id: sqlite.php,v 1.151 2007/09/23 17:24:32 quipo Exp $ // /** @@ -344,7 +344,8 @@ { $database_file = $this->_getDatabaseFile($this->database_name); if (is_resource($this->connection)) { - if (count(array_diff($this->connected_dsn, $this->dsn)) == 0 + //if (count(array_diff($this->connected_dsn, $this->dsn)) == 0 + if (MDB2::areEquals($this->connected_dsn, $this->dsn) && $this->connected_database_name == $database_file && $this->opened_persistent == $this->options['persistent'] ) {
« previous php.pear.cvs (#48650) next »