cvs: pear /DB/DB mysql.php
| From: | Tomas V.V.Cox | Date: | Thu, 23 May 2002 09:14:37 +0000 |
| Subject: | cvs: pear /DB/DB mysql.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4046@lists.php.net to get a copy of this message | ||
cox Thu May 23 05:14:37 2002 EDT
Modified files:
/pear/DB/DB mysql.php
Log:
Fix a possible bug with sequences updated in the wrong database
when using multiple mysql connections in the same script and the
same user/pass/host in connect
Index: pear/DB/DB/mysql.php
diff -u pear/DB/DB/mysql.php:1.3 pear/DB/DB/mysql.php:1.4
--- pear/DB/DB/mysql.php:1.3 Thu May 9 08:29:53 2002
+++ pear/DB/DB/mysql.php Thu May 23 05:14:37 2002
@@ -16,7 +16,7 @@
// | Author: Stig Bakken <ssb@fast.no> |
// +----------------------------------------------------------------------+
//
-// $Id: mysql.php,v 1.3 2002/05/09 12:29:53 ssb Exp $
+// $Id: mysql.php,v 1.4 2002/05/23 09:14:37 cox Exp $
//
// Database independent query interface definition for PHP's MySQL
// extension.
@@ -504,6 +504,9 @@
function nextId($seq_name, $ondemand = true)
{
$seqname = $this->getSequenceName($seq_name);
+ if (!@mysql_select_db($this->_db, $this->connection)) {
+ return $this->mysqlRaiseError(DB_ERROR_NODBSELECTED);
+ }
do {
$repeat = 0;
$this->pushErrorHandling(PEAR_ERROR_RETURN);