PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB » Bug #696

Some notices can appear

Details

Submitted2004-02-06 11:55 UTC
Fromsmailling at free dot fr
Assigneddanielc
StatusClosed
PackageDB
PHP VersionIrrelevant
OSWindows 2000
Roadmaps(Not assigned)

Comments

[2004-02-06 11:55 UTC] smailling at free dot fr

Description:
------------
If we don't specify the port in the dsn, a notice can occur.
I added some other check that can appear sometimes.

Reproduce code:
---------------
RCS file: /repository/pear/DB/DB/mysql.php,v
retrieving revision 1.56
diff -w -b -r1.56 mysql.php
123c123
< if ($dsninfo['port']) {
---
> if (isset($dsninfo['port'])) {
212c212
< if (!@mysql_select_db($this->_db, $this->connection)) {
---
> if (!is_resource($this->connection) || !@mysql_select_db($this->_db, $this->connection)) {
762a763
> if (is_resource($this->connection))
764c765
< @mysql_errno($this->connection) . ' ** ' .
---
> @mysql_errno($this->connection) . " ** " .
765a767,770
> else
> return $this->raiseError($errno, null, null, null,
> @mysql_errno() . " ** " .
> @mysql_error());