cvs: pear /DB package.xml /DB/DB pgsql.php
| From: | Daniel Convissor | Date: | Fri, 27 May 2005 15:48:18 +0000 |
| Subject: | cvs: pear /DB package.xml /DB/DB pgsql.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-32159@lists.php.net to get a copy of this message | ||
danielc Fri May 27 11:48:18 2005 EDT
Modified files:
/pear/DB package.xml
/pear/DB/DB pgsql.php
Log:
* If connection is lost, raise DB_ERROR_CONNECT_FAILED
instead of the generic DB_ERROR. Bug 4446.
http://cvs.php.net/diff.php/pear/DB/package.xml?r1=1.186&r2=1.187&ty=u
Index: pear/DB/package.xml
diff -u pear/DB/package.xml:1.186 pear/DB/package.xml:1.187
--- pear/DB/package.xml:1.186 Fri May 27 11:32:34 2005
+++ pear/DB/package.xml Fri May 27 11:48:17 2005
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<package version="1.0">
- <!-- $Id: package.xml,v 1.186 2005/05/27 15:32:34 danielc Exp $ -->
+ <!-- $Id: package.xml,v 1.187 2005/05/27 15:48:17 danielc Exp $ -->
<name>DB</name>
<summary>Database Abstraction Layer</summary>
<description>
@@ -74,6 +74,9 @@
* When inserting to non-existant column, produce
proper error, "no such field", instead of
"no such table". Bug 4365.
+
+* If connection is lost, raise DB_ERROR_CONNECT_FAILED
+ instead of the generic DB_ERROR. Bug 4446.
]]></notes>
<filelist>
<file name="DB.php" role="php" baseinstalldir="/">
http://cvs.php.net/diff.php/pear/DB/DB/pgsql.php?r1=1.127&r2=1.128&ty=u
Index: pear/DB/DB/pgsql.php
diff -u pear/DB/DB/pgsql.php:1.127 pear/DB/DB/pgsql.php:1.128
--- pear/DB/DB/pgsql.php:1.127 Fri May 27 11:32:34 2005
+++ pear/DB/DB/pgsql.php Fri May 27 11:48:18 2005
@@ -21,7 +21,7 @@
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: pgsql.php,v 1.127 2005/05/27 15:32:34 danielc Exp $
+ * @version CVS: $Id: pgsql.php,v 1.128 2005/05/27 15:48:18 danielc Exp $
* @link http://pear.php.net/package/DB
*/
@@ -779,6 +779,10 @@
function pgsqlRaiseError($errno = null)
{
$native = $this->errorNative();
+ if (!$native) {
+ $native = 'Database connection has been lost.';
+ $errno = DB_ERROR_CONNECT_FAILED;
+ }
if ($errno === null) {
$errno = $this->errorCode($native);
}