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 » MDB2 » Bug #9667

Errors out if not enough permissions

Details

Submitted2006-12-20 21:40 UTC
Fromstefanvalouch at googlemail dot com
Assignedquipo
StatusBogus
PackageMDB2
PHP Version5.2.0
Roadmaps(Not assigned)

Comments

[2006-12-20 21:40 UTC] stefanvalouch at googlemail dot com

Description:
------------
A user that was just generated had no permissions to access the database. Instead of giving out an error-object, the whole application stopped.

Test script:
---------------
require_once "MDB2.php";
$dsn = array (
'phptype' => $db['type'],
'username' => $db['user'],
'password' => $db['passwd'],
'hostspec' => $db['host'],
'database' => $db['database']
);
$options = array ('debug' => 2, 'result_buffering' => true, 'portability' => MDB2_PORTABILITY_ALL);
$db = & MDB2 :: factory($dsn, $options);
if (PEAR :: isError($db)) {
echo $db->getMessage();
echo "<br />";
echo $db->getDebugInfo();
}

Expected result:
----------------
Giving out an error-message as programmed and continuing with the rest of the script

Actual result:
--------------
Catchable fatal error: Object of class MDB2_Error could not be converted to string in /usr/share/pear/MDB2/Driver/Datatype/Common.php on line 1148