cvs: pear /DB package.xml /DB/DB mysql.php mysqli.php
| From: | Adam Harvey | Date: | Fri, 21 Sep 2007 13:32:52 +0000 |
| Subject: | cvs: pear /DB package.xml /DB/DB mysql.php mysqli.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-48643@lists.php.net to get a copy of this message | ||
aharvey Fri Sep 21 13:32:52 2007 UTC
Modified files:
/pear/DB package.xml
/pear/DB/DB mysql.php mysqli.php
Log:
Fix for bug #11580 (DB_mysql::tableInfo() bug when using several connections).
http://cvs.php.net/viewvc.cgi/pear/DB/package.xml?r1=1.233&r2=1.234&diff_format=u
Index: pear/DB/package.xml
diff -u pear/DB/package.xml:1.233 pear/DB/package.xml:1.234
--- pear/DB/package.xml:1.233 Fri Jun 29 13:10:40 2007
+++ pear/DB/package.xml Fri Sep 21 13:32:52 2007
@@ -65,10 +65,10 @@
<email>cox@idecnet.com</email>
<active>yes</active>
</developer>
- <date>2007-06-29</date>
+ <date>2007-09-21</date>
<version>
- <release>1.7.12</release>
- <api>1.7.12</api>
+ <release>1.7.13</release>
+ <api>1.7.13</api>
</version>
<stability>
<release>stable</release>
@@ -76,19 +76,13 @@
</stability>
<license uri="http://www.php.net/license">PHP
License</license>
<notes>
-This release of DB fixes an issue that prevented PostgreSQL users from escaping values with PHP
5.2.
+This release of DB fixes a number of minor issues reported since the release of DB 1.7.12.
-Please note that this version of DB has removed the version 1 package.xml file. Consequently, PEAR
1.4 or later must be used to install this version of DB and any future versions.
+mysql:
+* Added an explicit call to select the database to fix calls to tableInfo() without a preceding
query. Bug 11580.
-oci8:
-* Added view support to getSpecialQuery() for feature parity with other backends. Request 11110.
-
-pgsql:
-* Added schema.views support to getSpecialQuery() to avoid disadvantaging views within schemas.
Request 11080.
-* Changed parameter escaping to correctly pass up the DB connection. Bug 11125.
-
-tests:
-* Updated DIVZERO tests to reflect which DB backends actually return errors upon division by zero.
Bug 10894.
+mysqli:
+* Added an explicit call to select the database to fix calls to tableInfo() without a preceding
query. Bug 11580.
</notes>
<contents>
<dir name="/">
http://cvs.php.net/viewvc.cgi/pear/DB/DB/mysql.php?r1=1.125&r2=1.126&diff_format=u
Index: pear/DB/DB/mysql.php
diff -u pear/DB/DB/mysql.php:1.125 pear/DB/DB/mysql.php:1.126
--- pear/DB/DB/mysql.php:1.125 Fri Jul 6 05:19:21 2007
+++ pear/DB/DB/mysql.php Fri Sep 21 13:32:52 2007
@@ -20,7 +20,7 @@
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2007 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: mysql.php,v 1.125 2007/07/06 05:19:21 aharvey Exp $
+ * @version CVS: $Id: mysql.php,v 1.126 2007/09/21 13:32:52 aharvey Exp $
* @link http://pear.php.net/package/DB
*/
@@ -932,6 +932,13 @@
function tableInfo($result, $mode = null)
{
if (is_string($result)) {
+ // Fix for bug #11580.
+ if ($this->_db) {
+ if (!@mysql_select_db($this->_db, $this->connection)) {
+ return $this->mysqlRaiseError(DB_ERROR_NODBSELECTED);
+ }
+ }
+
/*
* Probably received a table name.
* Create a result resource identifier.
http://cvs.php.net/viewvc.cgi/pear/DB/DB/mysqli.php?r1=1.80&r2=1.81&diff_format=u
Index: pear/DB/DB/mysqli.php
diff -u pear/DB/DB/mysqli.php:1.80 pear/DB/DB/mysqli.php:1.81
--- pear/DB/DB/mysqli.php:1.80 Fri Jul 6 05:19:21 2007
+++ pear/DB/DB/mysqli.php Fri Sep 21 13:32:52 2007
@@ -19,7 +19,7 @@
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2007 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: mysqli.php,v 1.80 2007/07/06 05:19:21 aharvey Exp $
+ * @version CVS: $Id: mysqli.php,v 1.81 2007/09/21 13:32:52 aharvey Exp $
* @link http://pear.php.net/package/DB
*/
@@ -962,6 +962,13 @@
function tableInfo($result, $mode = null)
{
if (is_string($result)) {
+ // Fix for bug #11580.
+ if ($this->_db) {
+ if (!@mysqli_select_db($this->connection, $this->_db)) {
+ return $this->mysqliRaiseError(DB_ERROR_NODBSELECTED);
+ }
+ }
+
/*
* Probably received a table name.
* Create a result resource identifier.