<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=MDB2</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/16739" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16364" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16280" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16246" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15373" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15232" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14518" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14500" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14314" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14060" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13649" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13389" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12157" />
      <rdf:li rdf:resource="http://pear.php.net/bug/11108" />
      <rdf:li rdf:resource="http://pear.php.net/bug/9332" />
      <rdf:li rdf:resource="http://pear.php.net/bug/8413" />
      <rdf:li rdf:resource="http://pear.php.net/bug/6907" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/16739">
      <title>MDB2: Bug 16739 [Open] Transaction rolledback with persistant connection</title>
      <link>http://pear.php.net/bugs/16739</link>
      <content:encoded><![CDATA[<pre>MDB2 Bug
Reported by vivien
2009-10-24T21:38:12+00:00
PHP: 5.2.5 OS: Linux Package Version: 2.5.0b2

Description:
------------
Started transaction are automatically rolled back when the PHP script terminates which may be inconvenient for persistant connections (this behaviour has been tested for PostgreSQL, MySQL and SQLite at least), as visible in the disconnect() method.

I really need a way to disable that automatic rolling back.

I know that when the connection is opened again at least the @in_transaction and @nested_transaction_counter attributes of the connection _will_ be wrong because the connection is persistant, but maybe a solution can be found using $_SESSION to save all that extra information about the connection's transaction status.

I really need that bug corrected,
thanks a lot</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Bug
Reported by vivien
2009-10-24T21:38:12+00:00
PHP: 5.2.5 OS: Linux Package Version: 2.5.0b2

Description:
------------
Started transaction are automatically rolled back when the PHP script terminates which may be inconvenient for persistant connections (this behaviour has been tested for PostgreSQL, MySQL and SQLite at least), as visible in the disconnect() method.

I really need a way to disable that automatic rolling back.

I know that when the connection is opened again at least the @in_transaction and @nested_transaction_counter attributes of the connection _will_ be wrong because the connection is persistant, but maybe a solution can be found using $_SESSION to save all that extra information about the connection's transaction status.

I really need that bug corrected,
thanks a lot</pre>]]></description>
      <dc:date>2009-10-24T21:38:12+00:00</dc:date>
      <dc:creator>malerba &amp;#x61;&amp;#116; gnome-db &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>MDB2 Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16364">
      <title>MDB2: Feature/Change Request 16364 [Open] Add database user creation support</title>
      <link>http://pear.php.net/bugs/16364</link>
      <content:encoded><![CDATA[<pre>MDB2 Feature/Change Request
Reported by richsage
2009-06-22T16:38:41+00:00
PHP: 5.2.9 OS: Fedora Linux Package Version: 2.4.1

Description:
------------
Implement in the Manager module a method eg createUser(string $username, string $password, string $database, object $permissions) which would allow the creation of a database user with the supplied password and perhaps an object with relevant permissions (eg ALTER, GRANT etc), assigning the user to a database.

Associated methods would allow the subsequent changing of passwords for users, and assignment of users to individual database.</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Feature/Change Request
Reported by richsage
2009-06-22T16:38:41+00:00
PHP: 5.2.9 OS: Fedora Linux Package Version: 2.4.1

Description:
------------
Implement in the Manager module a method eg createUser(string $username, string $password, string $database, object $permissions) which would allow the creation of a database user with the supplied password and perhaps an object with relevant permissions (eg ALTER, GRANT etc), assigning the user to a database.

Associated methods would allow the subsequent changing of passwords for users, and assignment of users to individual database.</pre>]]></description>
      <dc:date>2009-06-22T16:38:41+00:00</dc:date>
      <dc:creator>rich &amp;#x64;&amp;#111;&amp;#x74; sage &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16280">
      <title>MDB2: Bug 16280 [Assigned] compareDefinition() turns NULL defaults into empty strings for NOT NULL columns</title>
      <link>http://pear.php.net/bugs/16280</link>
      <content:encoded><![CDATA[<pre>MDB2 Bug
Reported by hschletz
2009-06-02T15:52:39+00:00
PHP: Irrelevant OS:  Package Version: 2.5.0b2

Description:
------------
I stumbled upon this bug when I tried to remove a default value (i.e. setting it to NULL) with MDB2_Schema. The code example below is based on the intermediate results from this operation.

It turned out to be a bug in the compareDefinition() method of the MDB2_Driver_Datatype_Common class. If the column has the notnull attribute set to true and the default attribute is not present in the new definition, an empty string is assumed instead od NULL. In my case the old value was an empty string, so that the change did not get detected.

If the 'default' attribute is present and set to NULL, everything works as expected. However, the assumption of the empty string is incorrect: NULL is a perfectly valid default even for NOT NULL columns.

I'm not sure whether the MDB2_PORTABILITY_EMPTY_TO_NULL should affect the behavior. The attached patch ignores this option.


Test script:
---------------
$previous =array (
    'notnull' =&gt; true,
    'nativetype' =&gt; 'varchar',
    'length' =&gt; '50',
    'fixed' =&gt; false,
    'default' =&gt; '',
    'type' =&gt; 'text',
    'mdb2type' =&gt; 'text',
    'was' =&gt; 'name'
);
$current = array (
    'type' =&gt; 'text',
    'length' =&gt; '50',
    'notnull' =&gt; true,
    'was' =&gt; 'name');
);
print_r ($mdb2-&gt;compareDefinition ($current, $previous));


Expected result:
----------------
array (
    [default] =&gt; 1
)


Actual result:
--------------
array (
)</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Bug
Reported by hschletz
2009-06-02T15:52:39+00:00
PHP: Irrelevant OS:  Package Version: 2.5.0b2

Description:
------------
I stumbled upon this bug when I tried to remove a default value (i.e. setting it to NULL) with MDB2_Schema. The code example below is based on the intermediate results from this operation.

It turned out to be a bug in the compareDefinition() method of the MDB2_Driver_Datatype_Common class. If the column has the notnull attribute set to true and the default attribute is not present in the new definition, an empty string is assumed instead od NULL. In my case the old value was an empty string, so that the change did not get detected.

If the 'default' attribute is present and set to NULL, everything works as expected. However, the assumption of the empty string is incorrect: NULL is a perfectly valid default even for NOT NULL columns.

I'm not sure whether the MDB2_PORTABILITY_EMPTY_TO_NULL should affect the behavior. The attached patch ignores this option.


Test script:
---------------
$previous =array (
    'notnull' =&gt; true,
    'nativetype' =&gt; 'varchar',
    'length' =&gt; '50',
    'fixed' =&gt; false,
    'default' =&gt; '',
    'type' =&gt; 'text',
    'mdb2type' =&gt; 'text',
    'was' =&gt; 'name'
);
$current = array (
    'type' =&gt; 'text',
    'length' =&gt; '50',
    'notnull' =&gt; true,
    'was' =&gt; 'name');
);
print_r ($mdb2-&gt;compareDefinition ($current, $previous));


Expected result:
----------------
array (
    [default] =&gt; 1
)


Actual result:
--------------
array (
)</pre>]]></description>
      <dc:date>2009-06-03T02:58:08+00:00</dc:date>
      <dc:creator>holger &amp;#x64;&amp;#111;&amp;#x74; schletz &amp;#x61;&amp;#116; web &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>MDB2 Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16246">
      <title>MDB2: Bug 16246 [Open] bindParam doesnt work with out params under oci8</title>
      <link>http://pear.php.net/bugs/16246</link>
      <content:encoded><![CDATA[<pre>MDB2 Bug
Reported by hannibal218
2009-05-21T11:35:47+00:00
PHP: 5.2.9 OS: centos 5.2 64bit Package Version: 

Description:
------------
if you try to call a stored procedure under mdb2 oci8, and that procedure has out params. you dont get the out params back.

i think that this actually breaks into two seperate problems.
the first one is that the calls to @OCIBindByName are missing a third variable that gives the size of the expected return value.  if , i changed localy :
if (!@OCIBindByName($this-&gt;statement, ':'.$parameter, $quoted_values[$i])) {
to :
if(!@OCIBindByName($this-&gt;statement, ':'.$parameter, $quoted_values[$i],32))

this gave me the out param values stored inside the $quoted_values array, this leads me to the second bug:

quoted_values is lost inside the function, its data is not added to the object returned by function my solution which is bad, was to add a third reference parameter to the _execute function, to hold that array :
&amp;_execute($result_class = true, $result_wrap_class = false , &amp;$result_params = array())


Test script:
---------------
  2 &lt;?php
  3 require_once &quot;MDB2.php&quot;;
  4
  5 /*
  6 //sayHello syntax
  7 CREATE OR REPLACE PROCEDURE
  8         sayHello (name IN VARCHAR2, greeting OUT VARCHAR2)
  9             AS
 10                 BEGIN
 11                     greeting := 'Hello ' || name;
 12                 END;
 13
 14 */
 15
 16
 17 $sql = 'begin sayHello(:inName, :inMessage); end;';
 18 $name = &quot;dor&quot;;
 19 $connStr = &quot;oci8://dispatcher:daparISZ@localhost/vcdb.videocells.com&quot;;
 20 echo &quot; ****************** OCI_INTERFACE **************** &lt;BR&gt;&quot;;
 21
 22 $conn = oci_connect(&quot;dispatcher&quot;,&quot;daparISZ&quot;,&quot;localhost/vcdb.videocells.com&quot;);
 23 $stmt = oci_parse($conn,$sql);
 24 oci_bind_by_name($stmt,':inName',$name,32);
 25 oci_bind_by_name($stmt,':inMessage',$message_OCI,32);
 26 oci_execute($stmt);
 27 echo &quot;message_OCI = $message_OCI &lt;br&gt;&quot;;
 28
 29 echo &quot; ****************** OCI_INTERFACE_END *********** &lt;BR&gt;&quot;;
 30 echo &quot; ****************** MDB_INTERFACE_START ********* &lt;BR&gt;&quot;;
 31 $mdb2 =&amp; MDB2::connect($connStr);
 32 if (PEAR::isError($mdb2))
 33 {
 34     die(__FILE__ .&quot; &quot;. __LINE__ .&quot; : &quot;. $mdb2-&gt;getMessage());
 35 }
 36
 37 $mdb2-&gt;setFetchMode(MDB2_FETCHMODE_ASSOC);
 38 $mdb2-&gt;LoadModule('Extended');
 39
 40 $statement = $mdb2-&gt;prepare($sql);
 41 $statement-&gt;bindParam(&quot;inName&quot;,$name);
 42 $statement-&gt;bindParam(&quot;inMessage&quot;,$message_MDB);
 43 $res = $statement-&gt;execute();
 44 echo &quot;message_MDB = $message_MDB &lt;br&gt;&quot;;
 45 $statement-&gt;free();
 46 echo &quot; ***************** MDB_INTERFACE_END *********** &lt;BR&gt;&quot;;
 47
 48 ?&gt;
 49


Expected result:
----------------
****************** OCI_INTERFACE ****************
message_OCI = Hello dor
****************** OCI_INTERFACE_END ***********
****************** MDB_INTERFACE_START *********
message_MDB = Hello dor 
***************** MDB_INTERFACE_END *********** 

Actual result:
--------------
****************** OCI_INTERFACE ****************
message_OCI = Hello dor
****************** OCI_INTERFACE_END ***********
****************** MDB_INTERFACE_START *********
message_MDB =
***************** MDB_INTERFACE_END ***********</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Bug
Reported by hannibal218
2009-05-21T11:35:47+00:00
PHP: 5.2.9 OS: centos 5.2 64bit Package Version: 

Description:
------------
if you try to call a stored procedure under mdb2 oci8, and that procedure has out params. you dont get the out params back.

i think that this actually breaks into two seperate problems.
the first one is that the calls to @OCIBindByName are missing a third variable that gives the size of the expected return value.  if , i changed localy :
if (!@OCIBindByName($this-&gt;statement, ':'.$parameter, $quoted_values[$i])) {
to :
if(!@OCIBindByName($this-&gt;statement, ':'.$parameter, $quoted_values[$i],32))

this gave me the out param values stored inside the $quoted_values array, this leads me to the second bug:

quoted_values is lost inside the function, its data is not added to the object returned by function my solution which is bad, was to add a third reference parameter to the _execute function, to hold that array :
&amp;_execute($result_class = true, $result_wrap_class = false , &amp;$result_params = array())


Test script:
---------------
  2 &lt;?php
  3 require_once &quot;MDB2.php&quot;;
  4
  5 /*
  6 //sayHello syntax
  7 CREATE OR REPLACE PROCEDURE
  8         sayHello (name IN VARCHAR2, greeting OUT VARCHAR2)
  9             AS
 10                 BEGIN
 11                     greeting := 'Hello ' || name;
 12                 END;
 13
 14 */
 15
 16
 17 $sql = 'begin sayHello(:inName, :inMessage); end;';
 18 $name = &quot;dor&quot;;
 19 $connStr = &quot;oci8://dispatcher:daparISZ@localhost/vcdb.videocells.com&quot;;
 20 echo &quot; ****************** OCI_INTERFACE **************** &lt;BR&gt;&quot;;
 21
 22 $conn = oci_connect(&quot;dispatcher&quot;,&quot;daparISZ&quot;,&quot;localhost/vcdb.videocells.com&quot;);
 23 $stmt = oci_parse($conn,$sql);
 24 oci_bind_by_name($stmt,':inName',$name,32);
 25 oci_bind_by_name($stmt,':inMessage',$message_OCI,32);
 26 oci_execute($stmt);
 27 echo &quot;message_OCI = $message_OCI &lt;br&gt;&quot;;
 28
 29 echo &quot; ****************** OCI_INTERFACE_END *********** &lt;BR&gt;&quot;;
 30 echo &quot; ****************** MDB_INTERFACE_START ********* &lt;BR&gt;&quot;;
 31 $mdb2 =&amp; MDB2::connect($connStr);
 32 if (PEAR::isError($mdb2))
 33 {
 34     die(__FILE__ .&quot; &quot;. __LINE__ .&quot; : &quot;. $mdb2-&gt;getMessage());
 35 }
 36
 37 $mdb2-&gt;setFetchMode(MDB2_FETCHMODE_ASSOC);
 38 $mdb2-&gt;LoadModule('Extended');
 39
 40 $statement = $mdb2-&gt;prepare($sql);
 41 $statement-&gt;bindParam(&quot;inName&quot;,$name);
 42 $statement-&gt;bindParam(&quot;inMessage&quot;,$message_MDB);
 43 $res = $statement-&gt;execute();
 44 echo &quot;message_MDB = $message_MDB &lt;br&gt;&quot;;
 45 $statement-&gt;free();
 46 echo &quot; ***************** MDB_INTERFACE_END *********** &lt;BR&gt;&quot;;
 47
 48 ?&gt;
 49


Expected result:
----------------
****************** OCI_INTERFACE ****************
message_OCI = Hello dor
****************** OCI_INTERFACE_END ***********
****************** MDB_INTERFACE_START *********
message_MDB = Hello dor 
***************** MDB_INTERFACE_END *********** 

Actual result:
--------------
****************** OCI_INTERFACE ****************
message_OCI = Hello dor
****************** OCI_INTERFACE_END ***********
****************** MDB_INTERFACE_START *********
message_MDB =
***************** MDB_INTERFACE_END ***********</pre>]]></description>
      <dc:date>2009-05-23T16:43:21+00:00</dc:date>
      <dc:creator>hannibal218 &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2 Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15373">
      <title>MDB2: Feature/Change Request 15373 [Open] Make compatable with SPL ArrayObject</title>
      <link>http://pear.php.net/bugs/15373</link>
      <content:encoded><![CDATA[<pre>MDB2 Feature/Change Request
Reported by snytkine
2008-12-21T10:43:41+00:00
PHP: 5.2.0 OS: RHEL4 Package Version: 2.5.0b1

Description:
------------
Hello!

I recently started using ArrayObject from SPL and its really good - I can extend the behaviour of array object ,add new methods, etc.. Sort of like changing array.prototype in JavaScript
as additional bonus, my arrays now passed by reference since they are actually objects now.
Anyway, the ArrayObject does not support array_keys() function, but it does support foreach()

What this means is that extended module like AutoExecute that uses array_keys() cannot handle ArrayObject

But if you use something like this instead:
$aKeys = array();
foreach($arr as $key =&gt; $val){
$aKeys[] = $key;
}
then it would work with ArrayObject objects.
What it would mean is that you could pass ArrayObject to AutoExecute

I only looked at AutoExecute method, I have a feeling there might be other methods in MDB2 that could be changed to use foreach() instead of array_keys.

It would just be a great enhancement for MDB2 to be compatible with ArrayObject type of objects</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Feature/Change Request
Reported by snytkine
2008-12-21T10:43:41+00:00
PHP: 5.2.0 OS: RHEL4 Package Version: 2.5.0b1

Description:
------------
Hello!

I recently started using ArrayObject from SPL and its really good - I can extend the behaviour of array object ,add new methods, etc.. Sort of like changing array.prototype in JavaScript
as additional bonus, my arrays now passed by reference since they are actually objects now.
Anyway, the ArrayObject does not support array_keys() function, but it does support foreach()

What this means is that extended module like AutoExecute that uses array_keys() cannot handle ArrayObject

But if you use something like this instead:
$aKeys = array();
foreach($arr as $key =&gt; $val){
$aKeys[] = $key;
}
then it would work with ArrayObject objects.
What it would mean is that you could pass ArrayObject to AutoExecute

I only looked at AutoExecute method, I have a feeling there might be other methods in MDB2 that could be changed to use foreach() instead of array_keys.

It would just be a great enhancement for MDB2 to be compatible with ArrayObject type of objects</pre>]]></description>
      <dc:date>2008-12-26T23:30:17+00:00</dc:date>
      <dc:creator>cert21 &amp;#x61;&amp;#116; ptd &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>MDB2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15232">
      <title>MDB2: Bug 15232 [Assigned] Multiple database handles seem to collide</title>
      <link>http://pear.php.net/bugs/15232</link>
      <content:encoded><![CDATA[<pre>MDB2 Bug
Reported by c0ntax
2008-12-04T04:17:44+00:00
PHP: 5.2.0 OS: 5.0.32-Debian_7etch8-log Package Version: 2.4.1

Description:
------------
If I create two database handles and then query against the first one I created, it runs the query against the second database connection. It seems that the most recent one is stamping over the top of the last.

Test script:
---------------
From the command line:

mysqladmin -u bob -p buttons create test1
mysqladmin -u bob -p buttons create test2

mysql -u bob -p buttons -e 'create table a (a int primary key); insert into a (a) values (1);' test1
mysql -u bob -p buttons -e 'create table b (b int primary key); insert into b (b) values (1);' test2

Now the script:

&lt;?php
require('MDB2.php');

$dsn1 = 'mysql://bob:buttons@localhost/test1';
$dsn2 = 'mysql://bob:buttons@localhost/test2';

$options = array(
	'debug' =&gt;			(true),
	'portability' =&gt;	MDB2_PORTABILITY_ALL,
	'persistent' =&gt;		false,
	'debug_handler' =&gt;	'db_debug_handler'
);

$dbh1 =&amp; MDB2::connect($dsn1, $options);
if (PEAR::isError($dbh1)) {
	print 'DBH1: ' . $dbh1-&gt;getMessage() . &quot;&lt;br&gt;\n&quot;;
}

$dbh2 =&amp; MDB2::connect($dsn2, $options);
if (PEAR::isError($dbh2)) {
	print 'DBH2: ' . $dbh2-&gt;getMessage() . &quot;&lt;br&gt;\n&quot;;
}

$result1 =&amp; $dbh1-&gt;query('SELECT * FROM a LIMIT 1');
var_dump($result1);
//$result2 =&amp; $dbh2-&gt;query('SELECT * FROM b LIMIT 1');
//var_dump($result2);
//$result3 =&amp; $dbh1-&gt;query('SELECT * FROM a LIMIT 1');
//var_dump($result3);




function db_debug_handler(&amp;$db, $scope, $message, $is_manip = null) {
	// call the default handler just so that we can later call getDebugOutput
	return MDB2_defaultDebugOutput($db, $scope, $message, $is_manip);
}

?&gt;

Expected result:
----------------
A MDB2_BufferedResult_mysql object with the contents of table 'a' in it

Actual result:
--------------
An MDB2_Error object with the following message:

_doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT * FROM a LIMIT 1]
[Native code: 1146]
[Native message: Table 'test2.a' doesn't exist]

The full backtrace is below. Notice how throughout all of it, the connected_database_name is test1 (as it should be) and not test2 (which is what it seems to use when executing the query)

object(MDB2_Error)[3]
  public 'error_message_prefix' =&gt; string '' (length=0)
  public 'mode' =&gt; int 1
  public 'level' =&gt; int 1024
  public 'code' =&gt; int -18
  public 'message' =&gt; string 'MDB2 Error: no such table' (length=25)
  public 'userinfo' =&gt; string '_doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT * FROM a LIMIT 1]
[Native code: 1146]
[Native message: Table 'test2.a' doesn't exist]
' (length=170)
  public 'backtrace' =&gt; 
    array
      0 =&gt; 
        array
          'file' =&gt; string '/home/bob/moo/docs/include/PEAR/MDB2.php' (length=43)
          'line' =&gt; int 973
          'function' =&gt; string 'PEAR_Error' (length=10)
          'class' =&gt; string 'PEAR_Error' (length=10)
          'object' =&gt; 
            &amp;object(MDB2_Error)[3]
          'type' =&gt; string '-&gt;' (length=2)
          'args' =&gt; 
            array
              0 =&gt; string 'MDB2 Error: no such table' (length=25)
              1 =&gt; int -18
              2 =&gt; int 1
              3 =&gt; int 1024
              4 =&gt; string '_doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT * FROM a LIMIT 1]
[Native code: 1146]
[Native message: Table 'test2.a' doesn't exist]
' (length=170)
      1 =&gt; 
        array
          'file' =&gt; string '/home/bob/moo/docs/include/PEAR/PEAR.php' (length=43)
          'line' =&gt; int 564
          'function' =&gt; string 'MDB2_Error' (length=10)
          'class' =&gt; string 'MDB2_Error' (length=10)
          'object' =&gt; 
            &amp;object(MDB2_Error)[3]
          'type' =&gt; string '-&gt;' (length=2)
          'args' =&gt; 
            array
              0 =&gt; int -18
              1 =&gt; int 1
              2 =&gt; int 1024
              3 =&gt; string '_doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT * FROM a LIMIT 1]
[Native code: 1146]
[Native message: Table 'test2.a' doesn't exist]
' (length=170)
      2 =&gt; 
        array
          'file' =&gt; string '/home/bob/moo/docs/include/PEAR/MDB2.php' (length=43)
          'line' =&gt; int 1442
          'function' =&gt; string 'raiseError' (length=10)
          'class' =&gt; string 'PEAR' (length=4)
          'object' =&gt; 
            object(MDB2_Driver_mysql)[1]
              public 'string_quoting' =&gt; 
                array
                  'start' =&gt; string ''' (length=1)
                  'end' =&gt; string ''' (length=1)
                  'escape' =&gt; string '\' (length=1)
                  'escape_pattern' =&gt; string '\' (length=1)
              public 'identifier_quoting' =&gt; 
                array
                  'start' =&gt; string '`' (length=1)
                  'end' =&gt; string '`' (length=1)
                  'escape' =&gt; string '`' (length=1)
              public 'sql_comments' =&gt; 
                array
                  0 =&gt; 
                    array
                      'start' =&gt; string '-- ' (length=3)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  1 =&gt; 
                    array
                      'start' =&gt; string '#' (length=1)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  2 =&gt; 
                    array
                      'start' =&gt; string '/*' (length=2)
                      'end' =&gt; string '*/' (length=2)
                      'escape' =&gt; boolean false
              public 'start_transaction' =&gt; boolean true
              public 'varchar_max_length' =&gt; int 65532
              public 'db_index' =&gt; int 1
              public 'dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connected_dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connection' =&gt; resource(5, mysql link)
              public 'opened_persistent' =&gt; boolean false
              public 'database_name' =&gt; string 'test1' (length=5)
              public 'connected_database_name' =&gt; string 'test1' (length=5)
              public 'connected_server_info' =&gt; string '5.0.32-Debian_7etch8-log' (length=24)
              public 'supported' =&gt; 
                array
                  'sequences' =&gt; string 'emulated' (length=8)
                  'indexes' =&gt; boolean true
                  'affected_rows' =&gt; boolean true
                  'summary_functions' =&gt; boolean true
                  'order_by_text' =&gt; boolean true
                  'transactions' =&gt; boolean true
                  'savepoints' =&gt; boolean true
                  'current_id' =&gt; string 'emulated' (length=8)
                  'limit_queries' =&gt; boolean true
                  'LOBs' =&gt; boolean true
                  'replace' =&gt; boolean true
                  'sub_selects' =&gt; boolean true
                  'auto_increment' =&gt; boolean true
                  'primary_key' =&gt; boolean true
                  'result_introspection' =&gt; boolean true
                  'prepared_statements' =&gt; boolean true
                  'identifier_quoting' =&gt; boolean true
                  'pattern_escaping' =&gt; boolean true
                  'new_link' =&gt; boolean true
              public 'options' =&gt; 
                array
                  'ssl' =&gt; boolean false
                  'field_case' =&gt; int 0
                  'disable_query' =&gt; boolean false
                  'result_class' =&gt; string 'MDB2_Result_%s' (length=14)
                  'buffered_result_class' =&gt; string 'MDB2_BufferedResult_%s' (length=22)
                  'result_wrap_class' =&gt; boolean false
                  'result_buffering' =&gt; boolean true
                  'fetch_class' =&gt; string 'stdClass' (length=8)
                  'persistent' =&gt; boolean false
                  'debug' =&gt; boolean true
                  'debug_handler' =&gt; string 'moodb_debug_handler' (length=19)
                  'debug_expanded_output' =&gt; boolean false
                  'default_text_field_length' =&gt; int 4096
                  'lob_buffer_length' =&gt; int 8192
                  'log_line_break' =&gt; string '
' (length=1)
                  'idxname_format' =&gt; string '%s_idx' (length=6)
                  'seqname_format' =&gt; string '%s_seq' (length=6)
                  'savepoint_format' =&gt; string 'MDB2_SAVEPOINT_%s' (length=17)
                  'statement_format' =&gt; string 'MDB2_STATEMENT_%1$s_%2$s' (length=24)
                  'seqcol_name' =&gt; string 'sequence' (length=8)
                  'quote_identifier' =&gt; boolean false
                  'use_transactions' =&gt; boolean true
                  'decimal_places' =&gt; int 2
                  'portability' =&gt; int 127
                  'modules' =&gt; 
                    array
                      'ex' =&gt; string 'Extended' (length=8)
                      'dt' =&gt; string 'Datatype' (length=8)
                      'mg' =&gt; string 'Manager' (length=7)

                      'rv' =&gt; string 'Reverse' (length=7)
                      'na' =&gt; string 'Native' (length=6)
                      'fc' =&gt; string 'Function' (length=8)
                  'emulate_prepared' =&gt; boolean false
                  'datatype_map' =&gt; 
                    array
                      empty
                  'datatype_map_callback' =&gt; 
                    array
                      empty
                  'nativetype_map_callback' =&gt; 
                    array
                      empty
                  'default_table_type' =&gt; string '' (length=0)
              public 'wildcards' =&gt; 
                array
                  0 =&gt; string '%' (length=1)
                  1 =&gt; string '_' (length=1)
              public 'as_keyword' =&gt; string ' AS ' (length=4)
              public 'warnings' =&gt; 
                array
                  empty
              public 'debug_output' =&gt; string 'query(1): SELECT * FROM a LIMIT 1
' (length=34)
              public 'in_transaction' =&gt; null
              public 'nested_transaction_counter' =&gt; null
              public 'has_transaction_error' =&gt; boolean false
              public 'offset' =&gt; int 0
              public 'limit' =&gt; int 0
              public 'phptype' =&gt; string 'mysql' (length=5)
              public 'dbsyntax' =&gt; string 'mysql' (length=5)
              public 'last_query' =&gt; string 'SELECT * FROM a LIMIT 1' (length=23)
              public 'fetchmode' =&gt; int 1
              public 'modules' =&gt; 
                array
                  empty
              public 'destructor_registered' =&gt; boolean true
              public '_debug' =&gt; boolean false
              public '_default_error_mode' =&gt; null
              public '_default_error_options' =&gt; null
              public '_default_error_handler' =&gt; string '' (length=0)
              public '_error_class' =&gt; string 'PEAR_Error' (length=10)
              public '_expected_errors' =&gt; 
                array
                  empty
          'type' =&gt; string '-&gt;' (length=2)
          'args' =&gt; 
            array
              0 =&gt; null
              1 =&gt; int -18
              2 =&gt; null
              3 =&gt; null
              4 =&gt; string '_doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT * FROM a LIMIT 1]
[Native code: 1146]
[Native message: Table 'test2.a' doesn't exist]
' (length=170)
              5 =&gt; string 'MDB2_Error' (length=10)
              6 =&gt; boolean true
      3 =&gt; 
        array
          'file' =&gt; string '/home/bob/moo/docs/include/PEAR/MDB2/Driver/mysql.php' (length=56)
          'line' =&gt; int 607
          'function' =&gt; string 'raiseError' (length=10)
          'class' =&gt; string 'MDB2_Driver_Common' (length=18)
          'object' =&gt; 
            object(MDB2_Driver_mysql)[1]
              public 'string_quoting' =&gt; 
                array
                  'start' =&gt; string ''' (length=1)
                  'end' =&gt; string ''' (length=1)
                  'escape' =&gt; string '\' (length=1)
                  'escape_pattern' =&gt; string '\' (length=1)
              public 'identifier_quoting' =&gt; 
                array
                  'start' =&gt; string '`' (length=1)
                  'end' =&gt; string '`' (length=1)
                  'escape' =&gt; string '`' (length=1)
              public 'sql_comments' =&gt; 
                array
                  0 =&gt; 
                    array
                      'start' =&gt; string '-- ' (length=3)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  1 =&gt; 
                    array
                      'start' =&gt; string '#' (length=1)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  2 =&gt; 
                    array
                      'start' =&gt; string '/*' (length=2)
                      'end' =&gt; string '*/' (length=2)
                      'escape' =&gt; boolean false
              public 'start_transaction' =&gt; boolean true
              public 'varchar_max_length' =&gt; int 65532
              public 'db_index' =&gt; int 1
              public 'dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connected_dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connection' =&gt; resource(5, mysql link)
              public 'opened_persistent' =&gt; boolean false
              public 'database_name' =&gt; string 'test1' (length=5)
              public 'connected_database_name' =&gt; string 'test1' (length=5)
              public 'connected_server_info' =&gt; string '5.0.32-Debian_7etch8-log' (length=24)
              public 'supported' =&gt; 
                array
                  'sequences' =&gt; string 'emulated' (length=8)
                  'indexes' =&gt; boolean true
                  'affected_rows' =&gt; boolean true
                  'summary_functions' =&gt; boolean true
                  'order_by_text' =&gt; boolean true
                  'transactions' =&gt; boolean true
                  'savepoints' =&gt; boolean true
                  'current_id' =&gt; string 'emulated' (length=8)
                  'limit_queries' =&gt; boolean true
                  'LOBs' =&gt; boolean true
                  'replace' =&gt; boolean true
                  'sub_selects' =&gt; boolean true
                  'auto_increment' =&gt; boolean true
                  'primary_key' =&gt; boolean true
                  'result_introspection' =&gt; boolean true
                  'prepared_statements' =&gt; boolean true
                  'identifier_quoting' =&gt; boolean true
                  'pattern_escaping' =&gt; boolean true
                  'new_link' =&gt; boolean true
              public 'options' =&gt; 
                array
                  'ssl' =&gt; boolean false
                  'field_case' =&gt; int 0
                  'disable_query' =&gt; boolean false
                  'result_class' =&gt; string 'MDB2_Result_%s' (length=14)
                  'buffered_result_class' =&gt; string 'MDB2_BufferedResult_%s' (length=22)
                  'result_wrap_class' =&gt; boolean false
                  'result_buffering' =&gt; boolean true
                  'fetch_class' =&gt; string 'stdClass' (length=8)
                  'persistent' =&gt; boolean false
                  'debug' =&gt; boolean true
                  'debug_handler' =&gt; string 'moodb_debug_handler' (length=19)
                  'debug_expanded_output' =&gt; boolean false
                  'default_text_field_length' =&gt; int 4096
                  'lob_buffer_length' =&gt; int 8192
                  'log_line_break' =&gt; string '
' (length=1)
                  'idxname_format' =&gt; string '%s_idx' (length=6)
                  'seqname_format' =&gt; string '%s_seq' (length=6)
                  'savepoint_format' =&gt; string 'MDB2_SAVEPOINT_%s' (length=17)
                  'statement_format' =&gt; string 'MDB2_STATEMENT_%1$s_%2$s' (length=24)
                  'seqcol_name' =&gt; string 'sequence' (length=8)
                  'quote_identifier' =&gt; boolean false
                  'use_transactions' =&gt; boolean true
                  'decimal_places' =&gt; int 2
                  'portability' =&gt; int 127
                  'modules' =&gt; 
                    array
                      'ex' =&gt; string 'Extended' (length=8)
                      'dt' =&gt; string 'Datatype' (length=8)
                      'mg' =&gt; string 'Manager' (length=7)
                      'rv' =&gt; string 'Reverse' (length=7)
                      'na' =&gt; string 'Native' (length=6)
                      'fc' =&gt; string 'Function' (length=8)
                  'emulate_prepared' =&gt; boolean false
                  'datatype_map' =&gt; 
                    array
                      empty
                  'datatype_map_callback' =&gt; 
                    array
                      empty
                  'nativetype_map_callback' =&gt; 
                    array
                      empty
                  'default_table_type' =&gt; string '' (length=0)
              public 'wildcards' =&gt; 
                array
                  0 =&gt; string '%' (length=1)
                  1 =&gt; string '_' (length=1)
              public 'as_keyword' =&gt; string ' AS ' (length=4)
              public 'warnings' =&gt; 
                array
                  empty
              public 'debug_output' =&gt; string 'query(1): SELECT * FROM a LIMIT 1
' (length=34)
              public 'in_transaction' =&gt; null
              public 'nested_transaction_counter' =&gt; null
              public 'has_transaction_error' =&gt; boolean false
              public 'offset' =&gt; int 0
              public 'limit' =&gt; int 0
              public 'phptype' =&gt; string 'mysql' (length=5)
              public 'dbsyntax' =&gt; string 'mysql' (length=5)
              public 'last_query' =&gt; string 'SELECT * FROM a LIMIT 1' (length=23)
              public 'fetchmode' =&gt; int 1
              public 'modules' =&gt; 
                array
                  empty
              public 'destructor_registered' =&gt; boolean true
              public '_debug' =&gt; boolean false
              public '_default_error_mode' =&gt; null
              public '_default_error_options' =&gt; null
              public '_default_error_handler' =&gt; string '' (length=0)
              public '_error_class' =&gt; string 'PEAR_Error' (length=10)
              public '_expected_errors' =&gt; 
                array
                  empty
          'type' =&gt; string '-&gt;' (length=2)
          'args' =&gt; 
            array
              0 =&gt; null
              1 =&gt; null
              2 =&gt; null
              3 =&gt; string 'Could not execute statement' (length=27)
              4 =&gt; string '_doQuery' (length=8)
      4 =&gt; 
        array
          'file' =&gt; string '/home/bob/moo/docs/include/PEAR/MDB2.php' (length=43)
          'line' =&gt; int 2514
          'function' =&gt; string '_doQuery' (length=8)
          'class' =&gt; string 'MDB2_Driver_mysql' (length=17)
          'object' =&gt; 
            object(MDB2_Driver_mysql)[1]
              public 'string_quoting' =&gt; 
                array
                  'start' =&gt; string ''' (length=1)
                  'end' =&gt; string ''' (length=1)
                  'escape' =&gt; string '\' (length=1)
                  'escape_pattern' =&gt; string '\' (length=1)
              public 'identifier_quoting' =&gt; 
                array
                  'start' =&gt; string '`' (length=1)
                  'end' =&gt; string '`' (length=1)
                  'escape' =&gt; string '`' (length=1)
              public 'sql_comments' =&gt; 
                array
                  0 =&gt; 
                    array
                      'start' =&gt; string '-- ' (length=3)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  1 =&gt; 
                    array
                      'start' =&gt; string '#' (length=1)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  2 =&gt; 
                    array
                      'start' =&gt; string '/*' (length=2)
                      'end' =&gt; string '*/' (length=2)
                      'escape' =&gt; boolean false
              public 'start_transaction' =&gt; boolean true
              public 'varchar_max_length' =&gt; int 65532
              public 'db_index' =&gt; int 1
              public 'dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connected_dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connection' =&gt; resource(5, mysql link)
              public 'opened_persistent' =&gt; boolean false
              public 'database_name' =&gt; string 'test1' (length=5)
              public 'connected_database_name' =&gt; string 'test1' (length=5)
              public 'connected_server_info' =&gt; string '5.0.32-Debian_7etch8-log' (length=24)
              public 'supported' =&gt; 
                array
                  'sequences' =&gt; string 'emulated' (length=8)
                  'indexes' =&gt; boolean true
                  'affected_rows' =&gt; boolean true
                  'summary_functions' =&gt; boolean true
                  'order_by_text' =&gt; boolean true
                  'transactions' =&gt; boolean true
                  'savepoints' =&gt; boolean true
                  'current_id' =&gt; string 'emulated' (length=8)
                  'limit_queries' =&gt; boolean true
                  'LOBs' =&gt; boolean true
                  'replace' =&gt; boolean true
                  'sub_selects' =&gt; boolean true
                  'auto_increment' =&gt; boolean true
                  'primary_key' =&gt; boolean true
                  'result_introspection' =&gt; boolean true
                  'prepared_statements' =&gt; boolean true
                  'identifier_quoting' =&gt; boolean true
                  'pattern_escaping' =&gt; boolean true
                  'new_link' =&gt; boolean true
              public 'options' =&gt; 
                array
                  'ssl' =&gt; boolean false
                  'field_case' =&gt; int 0
                  'disable_query' =&gt; boolean false
                  'result_class' =&gt; string 'MDB2_Result_%s' (length=14)
                  'buffered_result_class' =&gt; string 'MDB2_BufferedResult_%s' (length=22)
                  'result_wrap_class' =&gt; boolean false
                  'result_buffering' =&gt; boolean true
                  'fetch_class' =&gt; string 'stdClass' (length=8)
                  'persistent' =&gt; boolean false
                  'debug' =&gt; boolean true
                  'debug_handler' =&gt; string 'moodb_debug_handler' (length=19)
                  'debug_expanded_output' =&gt; boolean false
                  'default_text_field_length' =&gt; int 4096
                  'lob_buffer_length' =&gt; int 8192
                  'log_line_break' =&gt; string '
' (length=1)
                  'idxname_format' =&gt; string '%s_idx' (length=6)
                  'seqname_format' =&gt; string '%s_seq' (length=6)
                  'savepoint_format' =&gt; string 'MDB2_SAVEPOINT_%s' (length=17)
                  'statement_format' =&gt; string 'MDB2_STATEMENT_%1$s_%2$s' (length=24)
                  'seqcol_name' =&gt; string 'sequence' (length=8)
                  'quote_identifier' =&gt; boolean false
                  'use_transactions' =&gt; boolean true
                  'decimal_places' =&gt; int 2
                  'portability' =&gt; int 127
                  'modules' =&gt; 
                    array
                      'ex' =&gt; string 'Extended' (length=8)
                      'dt' =&gt; string 'Datatype' (length=8)
                      'mg' =&gt; string 'Manager' (length=7)
                      'rv' =&gt; string 'Reverse' (length=7)
                      'na' =&gt; string 'Native' (length=6)
                      'fc' =&gt; string 'Function' (length=8)
                  'emulate_prepared' =&gt; boolean false
                  'datatype_map' =&gt; 
                    array
                      empty
                  'datatype_map_callback' =&gt; 
                    array
                      empty
                  'nativetype_map_callback' =&gt; 
                    array
                      empty
                  'default_table_type' =&gt; string '' (length=0)
              public 'wildcards' =&gt; 
                array
                  0 =&gt; string '%' (length=1)
                  1 =&gt; string '_' (length=1)
              public 'as_keyword' =&gt; string ' AS ' (length=4)
              public 'warnings' =&gt; 
                array
                  empty
              public 'debug_output' =&gt; string 'query(1): SELECT * FROM a LIMIT 1
' (length=34)
              public 'in_transaction' =&gt; null
              public 'nested_transaction_counter' =&gt; null
              public 'has_transaction_error' =&gt; boolean false
              public 'offset' =&gt; int 0
              public 'limit' =&gt; int 0
              public 'phptype' =&gt; string 'mysql' (length=5)
              public 'dbsyntax' =&gt; string 'mysql' (length=5)
              public 'last_query' =&gt; string 'SELECT * FROM a LIMIT 1' (length=23)
              public 'fetchmode' =&gt; int 1
              public 'modules' =&gt; 
                array
                  empty
              public 'destructor_registered' =&gt; boolean true
              public '_debug' =&gt; boolean false
              public '_default_error_mode' =&gt; null
              public '_default_error_options' =&gt; null
              public '_default_error_handler' =&gt; string '' (length=0)
              public '_error_class' =&gt; string 'PEAR_Error' (length=10)
              public '_expected_errors' =&gt; 
                array
                  empty
          'type' =&gt; string '-&gt;' (length=2)
          'args' =&gt; 
            array
              0 =&gt; string 'SELECT * FROM a LIMIT 1' (length=23)
              1 =&gt; boolean false
              2 =&gt; resource(5, mysql link)
              3 =&gt; string 'test1' (length=5)
      5 =&gt; 
        array
          'file' =&gt; string '/home/bob/moo/docs/test.php' (length=30)
          'line' =&gt; int 31
          'function' =&gt; string 'query' (length=5)
          'class' =&gt; string 'MDB2_Driver_Common' (length=18)
          'object' =&gt; 
            object(MDB2_Driver_mysql)[1]
              public 'string_quoting' =&gt; 
                array
                  'start' =&gt; string ''' (length=1)
                  'end' =&gt; string ''' (length=1)
                  'escape' =&gt; string '\' (length=1)
                  'escape_pattern' =&gt; string '\' (length=1)
              public 'identifier_quoting' =&gt; 
                array
                  'start' =&gt; string '`' (length=1)
                  'end' =&gt; string '`' (length=1)
                  'escape' =&gt; string '`' (length=1)
              public 'sql_comments' =&gt; 
                array
                  0 =&gt; 
                    array
                      'start' =&gt; string '-- ' (length=3)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  1 =&gt; 
                    array
                      'start' =&gt; string '#' (length=1)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  2 =&gt; 
                    array
                      'start' =&gt; string '/*' (length=2)
                      'end' =&gt; string '*/' (length=2)
                      'escape' =&gt; boolean false
              public 'start_transaction' =&gt; boolean true
              public 'varchar_max_length' =&gt; int 65532
              public 'db_index' =&gt; int 1
              public 'dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connected_dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connection' =&gt; resource(5, mysql link)
              public 'opened_persistent' =&gt; boolean false
              public 'database_name' =&gt; string 'test1' (length=5)
              public 'connected_database_name' =&gt; string 'test1' (length=5)
              public 'connected_server_info' =&gt; string '5.0.32-Debian_7etch8-log' (length=24)
              public 'supported' =&gt; 
                array
                  'sequences' =&gt; string 'emulated' (length=8)
                  'indexes' =&gt; boolean true
                  'affected_rows' =&gt; boolean true
                  'summary_functions' =&gt; boolean true
                  'order_by_text' =&gt; boolean true
                  'transactions' =&gt; boolean true
                  'savepoints' =&gt; boolean true
                  'current_id' =&gt; string 'emulated' (length=8)
                  'limit_queries' =&gt; boolean true
                  'LOBs' =&gt; boolean true
                  'replace' =&gt; boolean true
                  'sub_selects' =&gt; boolean true
                  'auto_increment' =&gt; boolean true
                  'primary_key' =&gt; boolean true
                  'result_introspection' =&gt; boolean true
                  'prepared_statements' =&gt; boolean true
                  'identifier_quoting' =&gt; boolean true
                  'pattern_escaping' =&gt; boolean true
                  'new_link' =&gt; boolean true
              public 'options' =&gt; 
                array
                  'ssl' =&gt; boolean false
                  'field_case' =&gt; int 0
                  'disable_query' =&gt; boolean false
                  'result_class' =&gt; string 'MDB2_Result_%s' (length=14)
                  'buffered_result_class' =&gt; string 'MDB2_BufferedResult_%s' (length=22)
                  'result_wrap_class' =&gt; boolean false
                  'result_buffering' =&gt; boolean true
                  'fetch_class' =&gt; string 'stdClass' (length=8)
                  'persistent' =&gt; boolean false
                  'debug' =&gt; boolean true
                  'debug_handler' =&gt; string 'moodb_debug_handler' (length=19)
                  'debug_expanded_output' =&gt; boolean false
                  'default_text_field_length' =&gt; int 4096
                  'lob_buffer_length' =&gt; int 8192
                  'log_line_break' =&gt; string '
' (length=1)
                  'idxname_format' =&gt; string '%s_idx' (length=6)
                  'seqname_format' =&gt; string '%s_seq' (length=6)
                  'savepoint_format' =&gt; string 'MDB2_SAVEPOINT_%s' (length=17)
                  'statement_format' =&gt; string 'MDB2_STATEMENT_%1$s_%2$s' (length=24)
                  'seqcol_name' =&gt; string 'sequence' (length=8)
                  'quote_identifier' =&gt; boolean false
                  'use_transactions' =&gt; boolean true
                  'decimal_places' =&gt; int 2
                  'portability' =&gt; int 127
                  'modules' =&gt; 
                    array
                      'ex' =&gt; string 'Extended' (length=8)
                      'dt' =&gt; string 'Datatype' (length=8)
                      'mg' =&gt; string 'Manager' (length=7)
                      'rv' =&gt; string 'Reverse' (length=7)
                      'na' =&gt; string 'Native' (length=6)
                      'fc' =&gt; string 'Function' (length=8)
                  'emulate_prepared' =&gt; boolean false
                  'datatype_map' =&gt; 
                    array
                      empty
                  'datatype_map_callback' =&gt; 
                    array
                      empty
                  'nativetype_map_callback' =&gt; 
                    array
                      empty
                  'default_table_type' =&gt; string '' (length=0)
              public 'wildcards' =&gt; 
                array
                  0 =&gt; string '%' (length=1)
                  1 =&gt; string '_' (length=1)
              public 'as_keyword' =&gt; string ' AS ' (length=4)
              public 'warnings' =&gt; 
                array
                  empty
              public 'debug_output' =&gt; string 'query(1): SELECT * FROM a LIMIT 1
' (length=34)
              public 'in_transaction' =&gt; null
              public 'nested_transaction_counter' =&gt; null
              public 'has_transaction_error' =&gt; boolean false
              public 'offset' =&gt; int 0
              public 'limit' =&gt; int 0
              public 'phptype' =&gt; string 'mysql' (length=5)
              public 'dbsyntax' =&gt; string 'mysql' (length=5)
              public 'last_query' =&gt; string 'SELECT * FROM a LIMIT 1' (length=23)
              public 'fetchmode' =&gt; int 1
              public 'modules' =&gt; 
                array
                  empty
              public 'destructor_registered' =&gt; boolean true
              public '_debug' =&gt; boolean false
              public '_default_error_mode' =&gt; null
              public '_default_error_options' =&gt; null
              public '_default_error_handler' =&gt; string '' (length=0)
              public '_error_class' =&gt; string 'PEAR_Error' (length=10)
              public '_expected_errors' =&gt; 
                array
                  empty
          'type' =&gt; string '-&gt;' (length=2)
          'args' =&gt; 
            array
              0 =&gt; string 'SELECT * FROM a LIMIT 1' (length=23)
  public 'callback' =&gt; null</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Bug
Reported by c0ntax
2008-12-04T04:17:44+00:00
PHP: 5.2.0 OS: 5.0.32-Debian_7etch8-log Package Version: 2.4.1

Description:
------------
If I create two database handles and then query against the first one I created, it runs the query against the second database connection. It seems that the most recent one is stamping over the top of the last.

Test script:
---------------
From the command line:

mysqladmin -u bob -p buttons create test1
mysqladmin -u bob -p buttons create test2

mysql -u bob -p buttons -e 'create table a (a int primary key); insert into a (a) values (1);' test1
mysql -u bob -p buttons -e 'create table b (b int primary key); insert into b (b) values (1);' test2

Now the script:

&lt;?php
require('MDB2.php');

$dsn1 = 'mysql://bob:buttons@localhost/test1';
$dsn2 = 'mysql://bob:buttons@localhost/test2';

$options = array(
	'debug' =&gt;			(true),
	'portability' =&gt;	MDB2_PORTABILITY_ALL,
	'persistent' =&gt;		false,
	'debug_handler' =&gt;	'db_debug_handler'
);

$dbh1 =&amp; MDB2::connect($dsn1, $options);
if (PEAR::isError($dbh1)) {
	print 'DBH1: ' . $dbh1-&gt;getMessage() . &quot;&lt;br&gt;\n&quot;;
}

$dbh2 =&amp; MDB2::connect($dsn2, $options);
if (PEAR::isError($dbh2)) {
	print 'DBH2: ' . $dbh2-&gt;getMessage() . &quot;&lt;br&gt;\n&quot;;
}

$result1 =&amp; $dbh1-&gt;query('SELECT * FROM a LIMIT 1');
var_dump($result1);
//$result2 =&amp; $dbh2-&gt;query('SELECT * FROM b LIMIT 1');
//var_dump($result2);
//$result3 =&amp; $dbh1-&gt;query('SELECT * FROM a LIMIT 1');
//var_dump($result3);




function db_debug_handler(&amp;$db, $scope, $message, $is_manip = null) {
	// call the default handler just so that we can later call getDebugOutput
	return MDB2_defaultDebugOutput($db, $scope, $message, $is_manip);
}

?&gt;

Expected result:
----------------
A MDB2_BufferedResult_mysql object with the contents of table 'a' in it

Actual result:
--------------
An MDB2_Error object with the following message:

_doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT * FROM a LIMIT 1]
[Native code: 1146]
[Native message: Table 'test2.a' doesn't exist]

The full backtrace is below. Notice how throughout all of it, the connected_database_name is test1 (as it should be) and not test2 (which is what it seems to use when executing the query)

object(MDB2_Error)[3]
  public 'error_message_prefix' =&gt; string '' (length=0)
  public 'mode' =&gt; int 1
  public 'level' =&gt; int 1024
  public 'code' =&gt; int -18
  public 'message' =&gt; string 'MDB2 Error: no such table' (length=25)
  public 'userinfo' =&gt; string '_doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT * FROM a LIMIT 1]
[Native code: 1146]
[Native message: Table 'test2.a' doesn't exist]
' (length=170)
  public 'backtrace' =&gt; 
    array
      0 =&gt; 
        array
          'file' =&gt; string '/home/bob/moo/docs/include/PEAR/MDB2.php' (length=43)
          'line' =&gt; int 973
          'function' =&gt; string 'PEAR_Error' (length=10)
          'class' =&gt; string 'PEAR_Error' (length=10)
          'object' =&gt; 
            &amp;object(MDB2_Error)[3]
          'type' =&gt; string '-&gt;' (length=2)
          'args' =&gt; 
            array
              0 =&gt; string 'MDB2 Error: no such table' (length=25)
              1 =&gt; int -18
              2 =&gt; int 1
              3 =&gt; int 1024
              4 =&gt; string '_doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT * FROM a LIMIT 1]
[Native code: 1146]
[Native message: Table 'test2.a' doesn't exist]
' (length=170)
      1 =&gt; 
        array
          'file' =&gt; string '/home/bob/moo/docs/include/PEAR/PEAR.php' (length=43)
          'line' =&gt; int 564
          'function' =&gt; string 'MDB2_Error' (length=10)
          'class' =&gt; string 'MDB2_Error' (length=10)
          'object' =&gt; 
            &amp;object(MDB2_Error)[3]
          'type' =&gt; string '-&gt;' (length=2)
          'args' =&gt; 
            array
              0 =&gt; int -18
              1 =&gt; int 1
              2 =&gt; int 1024
              3 =&gt; string '_doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT * FROM a LIMIT 1]
[Native code: 1146]
[Native message: Table 'test2.a' doesn't exist]
' (length=170)
      2 =&gt; 
        array
          'file' =&gt; string '/home/bob/moo/docs/include/PEAR/MDB2.php' (length=43)
          'line' =&gt; int 1442
          'function' =&gt; string 'raiseError' (length=10)
          'class' =&gt; string 'PEAR' (length=4)
          'object' =&gt; 
            object(MDB2_Driver_mysql)[1]
              public 'string_quoting' =&gt; 
                array
                  'start' =&gt; string ''' (length=1)
                  'end' =&gt; string ''' (length=1)
                  'escape' =&gt; string '\' (length=1)
                  'escape_pattern' =&gt; string '\' (length=1)
              public 'identifier_quoting' =&gt; 
                array
                  'start' =&gt; string '`' (length=1)
                  'end' =&gt; string '`' (length=1)
                  'escape' =&gt; string '`' (length=1)
              public 'sql_comments' =&gt; 
                array
                  0 =&gt; 
                    array
                      'start' =&gt; string '-- ' (length=3)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  1 =&gt; 
                    array
                      'start' =&gt; string '#' (length=1)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  2 =&gt; 
                    array
                      'start' =&gt; string '/*' (length=2)
                      'end' =&gt; string '*/' (length=2)
                      'escape' =&gt; boolean false
              public 'start_transaction' =&gt; boolean true
              public 'varchar_max_length' =&gt; int 65532
              public 'db_index' =&gt; int 1
              public 'dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connected_dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connection' =&gt; resource(5, mysql link)
              public 'opened_persistent' =&gt; boolean false
              public 'database_name' =&gt; string 'test1' (length=5)
              public 'connected_database_name' =&gt; string 'test1' (length=5)
              public 'connected_server_info' =&gt; string '5.0.32-Debian_7etch8-log' (length=24)
              public 'supported' =&gt; 
                array
                  'sequences' =&gt; string 'emulated' (length=8)
                  'indexes' =&gt; boolean true
                  'affected_rows' =&gt; boolean true
                  'summary_functions' =&gt; boolean true
                  'order_by_text' =&gt; boolean true
                  'transactions' =&gt; boolean true
                  'savepoints' =&gt; boolean true
                  'current_id' =&gt; string 'emulated' (length=8)
                  'limit_queries' =&gt; boolean true
                  'LOBs' =&gt; boolean true
                  'replace' =&gt; boolean true
                  'sub_selects' =&gt; boolean true
                  'auto_increment' =&gt; boolean true
                  'primary_key' =&gt; boolean true
                  'result_introspection' =&gt; boolean true
                  'prepared_statements' =&gt; boolean true
                  'identifier_quoting' =&gt; boolean true
                  'pattern_escaping' =&gt; boolean true
                  'new_link' =&gt; boolean true
              public 'options' =&gt; 
                array
                  'ssl' =&gt; boolean false
                  'field_case' =&gt; int 0
                  'disable_query' =&gt; boolean false
                  'result_class' =&gt; string 'MDB2_Result_%s' (length=14)
                  'buffered_result_class' =&gt; string 'MDB2_BufferedResult_%s' (length=22)
                  'result_wrap_class' =&gt; boolean false
                  'result_buffering' =&gt; boolean true
                  'fetch_class' =&gt; string 'stdClass' (length=8)
                  'persistent' =&gt; boolean false
                  'debug' =&gt; boolean true
                  'debug_handler' =&gt; string 'moodb_debug_handler' (length=19)
                  'debug_expanded_output' =&gt; boolean false
                  'default_text_field_length' =&gt; int 4096
                  'lob_buffer_length' =&gt; int 8192
                  'log_line_break' =&gt; string '
' (length=1)
                  'idxname_format' =&gt; string '%s_idx' (length=6)
                  'seqname_format' =&gt; string '%s_seq' (length=6)
                  'savepoint_format' =&gt; string 'MDB2_SAVEPOINT_%s' (length=17)
                  'statement_format' =&gt; string 'MDB2_STATEMENT_%1$s_%2$s' (length=24)
                  'seqcol_name' =&gt; string 'sequence' (length=8)
                  'quote_identifier' =&gt; boolean false
                  'use_transactions' =&gt; boolean true
                  'decimal_places' =&gt; int 2
                  'portability' =&gt; int 127
                  'modules' =&gt; 
                    array
                      'ex' =&gt; string 'Extended' (length=8)
                      'dt' =&gt; string 'Datatype' (length=8)
                      'mg' =&gt; string 'Manager' (length=7)

                      'rv' =&gt; string 'Reverse' (length=7)
                      'na' =&gt; string 'Native' (length=6)
                      'fc' =&gt; string 'Function' (length=8)
                  'emulate_prepared' =&gt; boolean false
                  'datatype_map' =&gt; 
                    array
                      empty
                  'datatype_map_callback' =&gt; 
                    array
                      empty
                  'nativetype_map_callback' =&gt; 
                    array
                      empty
                  'default_table_type' =&gt; string '' (length=0)
              public 'wildcards' =&gt; 
                array
                  0 =&gt; string '%' (length=1)
                  1 =&gt; string '_' (length=1)
              public 'as_keyword' =&gt; string ' AS ' (length=4)
              public 'warnings' =&gt; 
                array
                  empty
              public 'debug_output' =&gt; string 'query(1): SELECT * FROM a LIMIT 1
' (length=34)
              public 'in_transaction' =&gt; null
              public 'nested_transaction_counter' =&gt; null
              public 'has_transaction_error' =&gt; boolean false
              public 'offset' =&gt; int 0
              public 'limit' =&gt; int 0
              public 'phptype' =&gt; string 'mysql' (length=5)
              public 'dbsyntax' =&gt; string 'mysql' (length=5)
              public 'last_query' =&gt; string 'SELECT * FROM a LIMIT 1' (length=23)
              public 'fetchmode' =&gt; int 1
              public 'modules' =&gt; 
                array
                  empty
              public 'destructor_registered' =&gt; boolean true
              public '_debug' =&gt; boolean false
              public '_default_error_mode' =&gt; null
              public '_default_error_options' =&gt; null
              public '_default_error_handler' =&gt; string '' (length=0)
              public '_error_class' =&gt; string 'PEAR_Error' (length=10)
              public '_expected_errors' =&gt; 
                array
                  empty
          'type' =&gt; string '-&gt;' (length=2)
          'args' =&gt; 
            array
              0 =&gt; null
              1 =&gt; int -18
              2 =&gt; null
              3 =&gt; null
              4 =&gt; string '_doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT * FROM a LIMIT 1]
[Native code: 1146]
[Native message: Table 'test2.a' doesn't exist]
' (length=170)
              5 =&gt; string 'MDB2_Error' (length=10)
              6 =&gt; boolean true
      3 =&gt; 
        array
          'file' =&gt; string '/home/bob/moo/docs/include/PEAR/MDB2/Driver/mysql.php' (length=56)
          'line' =&gt; int 607
          'function' =&gt; string 'raiseError' (length=10)
          'class' =&gt; string 'MDB2_Driver_Common' (length=18)
          'object' =&gt; 
            object(MDB2_Driver_mysql)[1]
              public 'string_quoting' =&gt; 
                array
                  'start' =&gt; string ''' (length=1)
                  'end' =&gt; string ''' (length=1)
                  'escape' =&gt; string '\' (length=1)
                  'escape_pattern' =&gt; string '\' (length=1)
              public 'identifier_quoting' =&gt; 
                array
                  'start' =&gt; string '`' (length=1)
                  'end' =&gt; string '`' (length=1)
                  'escape' =&gt; string '`' (length=1)
              public 'sql_comments' =&gt; 
                array
                  0 =&gt; 
                    array
                      'start' =&gt; string '-- ' (length=3)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  1 =&gt; 
                    array
                      'start' =&gt; string '#' (length=1)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  2 =&gt; 
                    array
                      'start' =&gt; string '/*' (length=2)
                      'end' =&gt; string '*/' (length=2)
                      'escape' =&gt; boolean false
              public 'start_transaction' =&gt; boolean true
              public 'varchar_max_length' =&gt; int 65532
              public 'db_index' =&gt; int 1
              public 'dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connected_dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connection' =&gt; resource(5, mysql link)
              public 'opened_persistent' =&gt; boolean false
              public 'database_name' =&gt; string 'test1' (length=5)
              public 'connected_database_name' =&gt; string 'test1' (length=5)
              public 'connected_server_info' =&gt; string '5.0.32-Debian_7etch8-log' (length=24)
              public 'supported' =&gt; 
                array
                  'sequences' =&gt; string 'emulated' (length=8)
                  'indexes' =&gt; boolean true
                  'affected_rows' =&gt; boolean true
                  'summary_functions' =&gt; boolean true
                  'order_by_text' =&gt; boolean true
                  'transactions' =&gt; boolean true
                  'savepoints' =&gt; boolean true
                  'current_id' =&gt; string 'emulated' (length=8)
                  'limit_queries' =&gt; boolean true
                  'LOBs' =&gt; boolean true
                  'replace' =&gt; boolean true
                  'sub_selects' =&gt; boolean true
                  'auto_increment' =&gt; boolean true
                  'primary_key' =&gt; boolean true
                  'result_introspection' =&gt; boolean true
                  'prepared_statements' =&gt; boolean true
                  'identifier_quoting' =&gt; boolean true
                  'pattern_escaping' =&gt; boolean true
                  'new_link' =&gt; boolean true
              public 'options' =&gt; 
                array
                  'ssl' =&gt; boolean false
                  'field_case' =&gt; int 0
                  'disable_query' =&gt; boolean false
                  'result_class' =&gt; string 'MDB2_Result_%s' (length=14)
                  'buffered_result_class' =&gt; string 'MDB2_BufferedResult_%s' (length=22)
                  'result_wrap_class' =&gt; boolean false
                  'result_buffering' =&gt; boolean true
                  'fetch_class' =&gt; string 'stdClass' (length=8)
                  'persistent' =&gt; boolean false
                  'debug' =&gt; boolean true
                  'debug_handler' =&gt; string 'moodb_debug_handler' (length=19)
                  'debug_expanded_output' =&gt; boolean false
                  'default_text_field_length' =&gt; int 4096
                  'lob_buffer_length' =&gt; int 8192
                  'log_line_break' =&gt; string '
' (length=1)
                  'idxname_format' =&gt; string '%s_idx' (length=6)
                  'seqname_format' =&gt; string '%s_seq' (length=6)
                  'savepoint_format' =&gt; string 'MDB2_SAVEPOINT_%s' (length=17)
                  'statement_format' =&gt; string 'MDB2_STATEMENT_%1$s_%2$s' (length=24)
                  'seqcol_name' =&gt; string 'sequence' (length=8)
                  'quote_identifier' =&gt; boolean false
                  'use_transactions' =&gt; boolean true
                  'decimal_places' =&gt; int 2
                  'portability' =&gt; int 127
                  'modules' =&gt; 
                    array
                      'ex' =&gt; string 'Extended' (length=8)
                      'dt' =&gt; string 'Datatype' (length=8)
                      'mg' =&gt; string 'Manager' (length=7)
                      'rv' =&gt; string 'Reverse' (length=7)
                      'na' =&gt; string 'Native' (length=6)
                      'fc' =&gt; string 'Function' (length=8)
                  'emulate_prepared' =&gt; boolean false
                  'datatype_map' =&gt; 
                    array
                      empty
                  'datatype_map_callback' =&gt; 
                    array
                      empty
                  'nativetype_map_callback' =&gt; 
                    array
                      empty
                  'default_table_type' =&gt; string '' (length=0)
              public 'wildcards' =&gt; 
                array
                  0 =&gt; string '%' (length=1)
                  1 =&gt; string '_' (length=1)
              public 'as_keyword' =&gt; string ' AS ' (length=4)
              public 'warnings' =&gt; 
                array
                  empty
              public 'debug_output' =&gt; string 'query(1): SELECT * FROM a LIMIT 1
' (length=34)
              public 'in_transaction' =&gt; null
              public 'nested_transaction_counter' =&gt; null
              public 'has_transaction_error' =&gt; boolean false
              public 'offset' =&gt; int 0
              public 'limit' =&gt; int 0
              public 'phptype' =&gt; string 'mysql' (length=5)
              public 'dbsyntax' =&gt; string 'mysql' (length=5)
              public 'last_query' =&gt; string 'SELECT * FROM a LIMIT 1' (length=23)
              public 'fetchmode' =&gt; int 1
              public 'modules' =&gt; 
                array
                  empty
              public 'destructor_registered' =&gt; boolean true
              public '_debug' =&gt; boolean false
              public '_default_error_mode' =&gt; null
              public '_default_error_options' =&gt; null
              public '_default_error_handler' =&gt; string '' (length=0)
              public '_error_class' =&gt; string 'PEAR_Error' (length=10)
              public '_expected_errors' =&gt; 
                array
                  empty
          'type' =&gt; string '-&gt;' (length=2)
          'args' =&gt; 
            array
              0 =&gt; null
              1 =&gt; null
              2 =&gt; null
              3 =&gt; string 'Could not execute statement' (length=27)
              4 =&gt; string '_doQuery' (length=8)
      4 =&gt; 
        array
          'file' =&gt; string '/home/bob/moo/docs/include/PEAR/MDB2.php' (length=43)
          'line' =&gt; int 2514
          'function' =&gt; string '_doQuery' (length=8)
          'class' =&gt; string 'MDB2_Driver_mysql' (length=17)
          'object' =&gt; 
            object(MDB2_Driver_mysql)[1]
              public 'string_quoting' =&gt; 
                array
                  'start' =&gt; string ''' (length=1)
                  'end' =&gt; string ''' (length=1)
                  'escape' =&gt; string '\' (length=1)
                  'escape_pattern' =&gt; string '\' (length=1)
              public 'identifier_quoting' =&gt; 
                array
                  'start' =&gt; string '`' (length=1)
                  'end' =&gt; string '`' (length=1)
                  'escape' =&gt; string '`' (length=1)
              public 'sql_comments' =&gt; 
                array
                  0 =&gt; 
                    array
                      'start' =&gt; string '-- ' (length=3)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  1 =&gt; 
                    array
                      'start' =&gt; string '#' (length=1)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  2 =&gt; 
                    array
                      'start' =&gt; string '/*' (length=2)
                      'end' =&gt; string '*/' (length=2)
                      'escape' =&gt; boolean false
              public 'start_transaction' =&gt; boolean true
              public 'varchar_max_length' =&gt; int 65532
              public 'db_index' =&gt; int 1
              public 'dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connected_dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connection' =&gt; resource(5, mysql link)
              public 'opened_persistent' =&gt; boolean false
              public 'database_name' =&gt; string 'test1' (length=5)
              public 'connected_database_name' =&gt; string 'test1' (length=5)
              public 'connected_server_info' =&gt; string '5.0.32-Debian_7etch8-log' (length=24)
              public 'supported' =&gt; 
                array
                  'sequences' =&gt; string 'emulated' (length=8)
                  'indexes' =&gt; boolean true
                  'affected_rows' =&gt; boolean true
                  'summary_functions' =&gt; boolean true
                  'order_by_text' =&gt; boolean true
                  'transactions' =&gt; boolean true
                  'savepoints' =&gt; boolean true
                  'current_id' =&gt; string 'emulated' (length=8)
                  'limit_queries' =&gt; boolean true
                  'LOBs' =&gt; boolean true
                  'replace' =&gt; boolean true
                  'sub_selects' =&gt; boolean true
                  'auto_increment' =&gt; boolean true
                  'primary_key' =&gt; boolean true
                  'result_introspection' =&gt; boolean true
                  'prepared_statements' =&gt; boolean true
                  'identifier_quoting' =&gt; boolean true
                  'pattern_escaping' =&gt; boolean true
                  'new_link' =&gt; boolean true
              public 'options' =&gt; 
                array
                  'ssl' =&gt; boolean false
                  'field_case' =&gt; int 0
                  'disable_query' =&gt; boolean false
                  'result_class' =&gt; string 'MDB2_Result_%s' (length=14)
                  'buffered_result_class' =&gt; string 'MDB2_BufferedResult_%s' (length=22)
                  'result_wrap_class' =&gt; boolean false
                  'result_buffering' =&gt; boolean true
                  'fetch_class' =&gt; string 'stdClass' (length=8)
                  'persistent' =&gt; boolean false
                  'debug' =&gt; boolean true
                  'debug_handler' =&gt; string 'moodb_debug_handler' (length=19)
                  'debug_expanded_output' =&gt; boolean false
                  'default_text_field_length' =&gt; int 4096
                  'lob_buffer_length' =&gt; int 8192
                  'log_line_break' =&gt; string '
' (length=1)
                  'idxname_format' =&gt; string '%s_idx' (length=6)
                  'seqname_format' =&gt; string '%s_seq' (length=6)
                  'savepoint_format' =&gt; string 'MDB2_SAVEPOINT_%s' (length=17)
                  'statement_format' =&gt; string 'MDB2_STATEMENT_%1$s_%2$s' (length=24)
                  'seqcol_name' =&gt; string 'sequence' (length=8)
                  'quote_identifier' =&gt; boolean false
                  'use_transactions' =&gt; boolean true
                  'decimal_places' =&gt; int 2
                  'portability' =&gt; int 127
                  'modules' =&gt; 
                    array
                      'ex' =&gt; string 'Extended' (length=8)
                      'dt' =&gt; string 'Datatype' (length=8)
                      'mg' =&gt; string 'Manager' (length=7)
                      'rv' =&gt; string 'Reverse' (length=7)
                      'na' =&gt; string 'Native' (length=6)
                      'fc' =&gt; string 'Function' (length=8)
                  'emulate_prepared' =&gt; boolean false
                  'datatype_map' =&gt; 
                    array
                      empty
                  'datatype_map_callback' =&gt; 
                    array
                      empty
                  'nativetype_map_callback' =&gt; 
                    array
                      empty
                  'default_table_type' =&gt; string '' (length=0)
              public 'wildcards' =&gt; 
                array
                  0 =&gt; string '%' (length=1)
                  1 =&gt; string '_' (length=1)
              public 'as_keyword' =&gt; string ' AS ' (length=4)
              public 'warnings' =&gt; 
                array
                  empty
              public 'debug_output' =&gt; string 'query(1): SELECT * FROM a LIMIT 1
' (length=34)
              public 'in_transaction' =&gt; null
              public 'nested_transaction_counter' =&gt; null
              public 'has_transaction_error' =&gt; boolean false
              public 'offset' =&gt; int 0
              public 'limit' =&gt; int 0
              public 'phptype' =&gt; string 'mysql' (length=5)
              public 'dbsyntax' =&gt; string 'mysql' (length=5)
              public 'last_query' =&gt; string 'SELECT * FROM a LIMIT 1' (length=23)
              public 'fetchmode' =&gt; int 1
              public 'modules' =&gt; 
                array
                  empty
              public 'destructor_registered' =&gt; boolean true
              public '_debug' =&gt; boolean false
              public '_default_error_mode' =&gt; null
              public '_default_error_options' =&gt; null
              public '_default_error_handler' =&gt; string '' (length=0)
              public '_error_class' =&gt; string 'PEAR_Error' (length=10)
              public '_expected_errors' =&gt; 
                array
                  empty
          'type' =&gt; string '-&gt;' (length=2)
          'args' =&gt; 
            array
              0 =&gt; string 'SELECT * FROM a LIMIT 1' (length=23)
              1 =&gt; boolean false
              2 =&gt; resource(5, mysql link)
              3 =&gt; string 'test1' (length=5)
      5 =&gt; 
        array
          'file' =&gt; string '/home/bob/moo/docs/test.php' (length=30)
          'line' =&gt; int 31
          'function' =&gt; string 'query' (length=5)
          'class' =&gt; string 'MDB2_Driver_Common' (length=18)
          'object' =&gt; 
            object(MDB2_Driver_mysql)[1]
              public 'string_quoting' =&gt; 
                array
                  'start' =&gt; string ''' (length=1)
                  'end' =&gt; string ''' (length=1)
                  'escape' =&gt; string '\' (length=1)
                  'escape_pattern' =&gt; string '\' (length=1)
              public 'identifier_quoting' =&gt; 
                array
                  'start' =&gt; string '`' (length=1)
                  'end' =&gt; string '`' (length=1)
                  'escape' =&gt; string '`' (length=1)
              public 'sql_comments' =&gt; 
                array
                  0 =&gt; 
                    array
                      'start' =&gt; string '-- ' (length=3)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  1 =&gt; 
                    array
                      'start' =&gt; string '#' (length=1)
                      'end' =&gt; string '
' (length=1)
                      'escape' =&gt; boolean false
                  2 =&gt; 
                    array
                      'start' =&gt; string '/*' (length=2)
                      'end' =&gt; string '*/' (length=2)
                      'escape' =&gt; boolean false
              public 'start_transaction' =&gt; boolean true
              public 'varchar_max_length' =&gt; int 65532
              public 'db_index' =&gt; int 1
              public 'dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connected_dsn' =&gt; 
                array
                  'phptype' =&gt; string 'mysql' (length=5)
                  'dbsyntax' =&gt; string 'mysql' (length=5)
                  'username' =&gt; string 'bob' (length=6)
                  'password' =&gt; string 'buttons' (length=9)
                  'protocol' =&gt; string 'tcp' (length=3)
                  'hostspec' =&gt; string 'localhost' (length=9)
                  'port' =&gt; boolean false
                  'socket' =&gt; boolean false
                  'database' =&gt; boolean false
                  'mode' =&gt; boolean false
              public 'connection' =&gt; resource(5, mysql link)
              public 'opened_persistent' =&gt; boolean false
              public 'database_name' =&gt; string 'test1' (length=5)
              public 'connected_database_name' =&gt; string 'test1' (length=5)
              public 'connected_server_info' =&gt; string '5.0.32-Debian_7etch8-log' (length=24)
              public 'supported' =&gt; 
                array
                  'sequences' =&gt; string 'emulated' (length=8)
                  'indexes' =&gt; boolean true
                  'affected_rows' =&gt; boolean true
                  'summary_functions' =&gt; boolean true
                  'order_by_text' =&gt; boolean true
                  'transactions' =&gt; boolean true
                  'savepoints' =&gt; boolean true
                  'current_id' =&gt; string 'emulated' (length=8)
                  'limit_queries' =&gt; boolean true
                  'LOBs' =&gt; boolean true
                  'replace' =&gt; boolean true
                  'sub_selects' =&gt; boolean true
                  'auto_increment' =&gt; boolean true
                  'primary_key' =&gt; boolean true
                  'result_introspection' =&gt; boolean true
                  'prepared_statements' =&gt; boolean true
                  'identifier_quoting' =&gt; boolean true
                  'pattern_escaping' =&gt; boolean true
                  'new_link' =&gt; boolean true
              public 'options' =&gt; 
                array
                  'ssl' =&gt; boolean false
                  'field_case' =&gt; int 0
                  'disable_query' =&gt; boolean false
                  'result_class' =&gt; string 'MDB2_Result_%s' (length=14)
                  'buffered_result_class' =&gt; string 'MDB2_BufferedResult_%s' (length=22)
                  'result_wrap_class' =&gt; boolean false
                  'result_buffering' =&gt; boolean true
                  'fetch_class' =&gt; string 'stdClass' (length=8)
                  'persistent' =&gt; boolean false
                  'debug' =&gt; boolean true
                  'debug_handler' =&gt; string 'moodb_debug_handler' (length=19)
                  'debug_expanded_output' =&gt; boolean false
                  'default_text_field_length' =&gt; int 4096
                  'lob_buffer_length' =&gt; int 8192
                  'log_line_break' =&gt; string '
' (length=1)
                  'idxname_format' =&gt; string '%s_idx' (length=6)
                  'seqname_format' =&gt; string '%s_seq' (length=6)
                  'savepoint_format' =&gt; string 'MDB2_SAVEPOINT_%s' (length=17)
                  'statement_format' =&gt; string 'MDB2_STATEMENT_%1$s_%2$s' (length=24)
                  'seqcol_name' =&gt; string 'sequence' (length=8)
                  'quote_identifier' =&gt; boolean false
                  'use_transactions' =&gt; boolean true
                  'decimal_places' =&gt; int 2
                  'portability' =&gt; int 127
                  'modules' =&gt; 
                    array
                      'ex' =&gt; string 'Extended' (length=8)
                      'dt' =&gt; string 'Datatype' (length=8)
                      'mg' =&gt; string 'Manager' (length=7)
                      'rv' =&gt; string 'Reverse' (length=7)
                      'na' =&gt; string 'Native' (length=6)
                      'fc' =&gt; string 'Function' (length=8)
                  'emulate_prepared' =&gt; boolean false
                  'datatype_map' =&gt; 
                    array
                      empty
                  'datatype_map_callback' =&gt; 
                    array
                      empty
                  'nativetype_map_callback' =&gt; 
                    array
                      empty
                  'default_table_type' =&gt; string '' (length=0)
              public 'wildcards' =&gt; 
                array
                  0 =&gt; string '%' (length=1)
                  1 =&gt; string '_' (length=1)
              public 'as_keyword' =&gt; string ' AS ' (length=4)
              public 'warnings' =&gt; 
                array
                  empty
              public 'debug_output' =&gt; string 'query(1): SELECT * FROM a LIMIT 1
' (length=34)
              public 'in_transaction' =&gt; null
              public 'nested_transaction_counter' =&gt; null
              public 'has_transaction_error' =&gt; boolean false
              public 'offset' =&gt; int 0
              public 'limit' =&gt; int 0
              public 'phptype' =&gt; string 'mysql' (length=5)
              public 'dbsyntax' =&gt; string 'mysql' (length=5)
              public 'last_query' =&gt; string 'SELECT * FROM a LIMIT 1' (length=23)
              public 'fetchmode' =&gt; int 1
              public 'modules' =&gt; 
                array
                  empty
              public 'destructor_registered' =&gt; boolean true
              public '_debug' =&gt; boolean false
              public '_default_error_mode' =&gt; null
              public '_default_error_options' =&gt; null
              public '_default_error_handler' =&gt; string '' (length=0)
              public '_error_class' =&gt; string 'PEAR_Error' (length=10)
              public '_expected_errors' =&gt; 
                array
                  empty
          'type' =&gt; string '-&gt;' (length=2)
          'args' =&gt; 
            array
              0 =&gt; string 'SELECT * FROM a LIMIT 1' (length=23)
  public 'callback' =&gt; null</pre>]]></description>
      <dc:date>2008-12-05T08:18:55+00:00</dc:date>
      <dc:creator>dan &amp;#x61;&amp;#116; moo &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2 Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14518">
      <title>MDB2: Feature/Change Request 14518 [Open] MDB2_AUTOQUERY_REPLACE</title>
      <link>http://pear.php.net/bugs/14518</link>
      <content:encoded><![CDATA[<pre>MDB2 Feature/Change Request
Reported by ponsfrilus
2008-08-18T09:23:58+00:00
PHP: Irrelevant OS:  Package Version: 

Description:
------------
MDB2_AUTOQUERY_REPLACE =&gt; http://dev.mysql.com/doc/refman/5.0/en/replace.html

would be excellent...</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Feature/Change Request
Reported by ponsfrilus
2008-08-18T09:23:58+00:00
PHP: Irrelevant OS:  Package Version: 

Description:
------------
MDB2_AUTOQUERY_REPLACE =&gt; http://dev.mysql.com/doc/refman/5.0/en/replace.html

would be excellent...</pre>]]></description>
      <dc:date>2008-12-08T04:35:19+00:00</dc:date>
      <dc:creator>ponsfrilus &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14500">
      <title>MDB2: Feature/Change Request 14500 [Open] Support MySQL extended insert with ExecuteMultiple</title>
      <link>http://pear.php.net/bugs/14500</link>
      <content:encoded><![CDATA[<pre>MDB2 Feature/Change Request
Reported by nicotine
2008-08-13T17:01:44+00:00
PHP: Irrelevant OS:  Package Version: 2.5.0b1

Description:
------------
If ExecuteMultiple could construct an extended insert on drivers that support it, it would increase performance when doing bulk inserts.

Test script:
---------------
&lt;?
$data = array(array(1,2,3),array(4,5,6),array(7,8,9));
$db-&gt;loadModule(&quot;Extended&quot;, null, false);
$sth = $db-&gt;prepare(&quot;INSERT INTO table (a,b,c) VALUES (?, ?, ?)&quot;);
$db-&gt;extended-&gt;executeMultiple($sth, $data);

Expected result:
----------------
1 SQL insert statement:
INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6),(7,8,9);

Actual result:
--------------
3 SQL insert statements
INSERT INTO table (a,b,c) VALUES (1,2,3);
INSERT INTO table (a,b,c) VALUES (4,5,6);
INSERT INTO table (a,b,c) VALUES (7,8,9)</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Feature/Change Request
Reported by nicotine
2008-08-13T17:01:44+00:00
PHP: Irrelevant OS:  Package Version: 2.5.0b1

Description:
------------
If ExecuteMultiple could construct an extended insert on drivers that support it, it would increase performance when doing bulk inserts.

Test script:
---------------
&lt;?
$data = array(array(1,2,3),array(4,5,6),array(7,8,9));
$db-&gt;loadModule(&quot;Extended&quot;, null, false);
$sth = $db-&gt;prepare(&quot;INSERT INTO table (a,b,c) VALUES (?, ?, ?)&quot;);
$db-&gt;extended-&gt;executeMultiple($sth, $data);

Expected result:
----------------
1 SQL insert statement:
INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6),(7,8,9);

Actual result:
--------------
3 SQL insert statements
INSERT INTO table (a,b,c) VALUES (1,2,3);
INSERT INTO table (a,b,c) VALUES (4,5,6);
INSERT INTO table (a,b,c) VALUES (7,8,9)</pre>]]></description>
      <dc:date>2008-08-31T12:01:21+00:00</dc:date>
      <dc:creator>nicotine &amp;#x61;&amp;#116; warningg &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14314">
      <title>MDB2: Bug 14314 [Open] mysql driver's nextID() captures too many errors</title>
      <link>http://pear.php.net/bugs/14314</link>
      <content:encoded><![CDATA[<pre>MDB2 Bug
Reported by haggholm
2008-07-08T18:22:34+00:00
PHP: 5.2.4 OS: All Package Version: 2.4.1

Description:
------------
In the MySQL driver (at least!), nextID() works by trying to insert a value into the appropriate *_seq table, catching an error if it fails, and creating the table if necessary. In so doing, as it cannot be simply assumed that the errorHandling mode is PEAR_ERROR_RETURN, it explicitly pushes this, and pops the mode back to the original when done. However, in the meanwhile, it makes a call which may return an error.

In the event that an error occur, it is expected to be a NO_SUCH_TABLE error, which is then handled gracefully. However, on the off chance that it ISN'T a NO_SUCH_TABLE error, the resulting MDB2_Error object is simply returned from the function. This is a problem if the error handling mode to begin with was anything but PEAR_ERROR_RETURN, since the calling code may not be prepared to check the return value (e.g. it may check for an exception or expect a trigger to fire).

It seems to me that the proper solution would be to either somehow re-raise the error, to ensure that the proper mechanism is invoked, or wrap the error message in some suitable construct. As things now stand, errors risk being propagated silently.

Test script:
---------------
Since, at the present time, I haven't figured out the root cause of the error that slips through, I have no script to offer; however, lines 1268:1280 of Driver/mysql.php (CVS) probably speak for themselves.

Expected result:
----------------
The appropriate exception, trigger, etc. should fire.

Actual result:
--------------
An MDB2_Error object is returned.</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Bug
Reported by haggholm
2008-07-08T18:22:34+00:00
PHP: 5.2.4 OS: All Package Version: 2.4.1

Description:
------------
In the MySQL driver (at least!), nextID() works by trying to insert a value into the appropriate *_seq table, catching an error if it fails, and creating the table if necessary. In so doing, as it cannot be simply assumed that the errorHandling mode is PEAR_ERROR_RETURN, it explicitly pushes this, and pops the mode back to the original when done. However, in the meanwhile, it makes a call which may return an error.

In the event that an error occur, it is expected to be a NO_SUCH_TABLE error, which is then handled gracefully. However, on the off chance that it ISN'T a NO_SUCH_TABLE error, the resulting MDB2_Error object is simply returned from the function. This is a problem if the error handling mode to begin with was anything but PEAR_ERROR_RETURN, since the calling code may not be prepared to check the return value (e.g. it may check for an exception or expect a trigger to fire).

It seems to me that the proper solution would be to either somehow re-raise the error, to ensure that the proper mechanism is invoked, or wrap the error message in some suitable construct. As things now stand, errors risk being propagated silently.

Test script:
---------------
Since, at the present time, I haven't figured out the root cause of the error that slips through, I have no script to offer; however, lines 1268:1280 of Driver/mysql.php (CVS) probably speak for themselves.

Expected result:
----------------
The appropriate exception, trigger, etc. should fire.

Actual result:
--------------
An MDB2_Error object is returned.</pre>]]></description>
      <dc:date>2008-07-08T18:22:34+00:00</dc:date>
      <dc:creator>petter &amp;#x61;&amp;#116; petterhaggholm &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>MDB2 Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14060">
      <title>MDB2: Documentation Problem 14060 [Open] Documentation example for looping rows from executeStoredProc</title>
      <link>http://pear.php.net/bugs/14060</link>
      <content:encoded><![CDATA[<pre>MDB2 Documentation Problem
Reported by gauthierm
2008-06-03T12:27:14+00:00
PHP: Irrelevant OS:  Package Version: 2.5.0b1

Description:
------------
I had some trouble today looping the results of MDB2::executeStoredProc() using MySQLi. I eventually got it to work using the pattern in the test script section. This example may be useful to add to the result documentation at http://pear.php.net/manual/en/package.database.mdb2.intro-fetch.php.

If you use the normal looping pattern, which is just the internal while loop, the result set will not be properly freed for MySQLi procedures. This causes out-of-sync errors when you call more than one procedure.

This behavior may be a bug, in which case the test script is merely a workaround.

Test script:
---------------
$rs = $db-&gt;executeStoredProcedure('procedureName', array('argument1'));

do {
    while ($row = $rs-&gt;fetchRow(MDB2_FETCHMODE_OBJECT)) {
        var_dump($row);
    }
} while ($rs-&gt;nextResult());</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Documentation Problem
Reported by gauthierm
2008-06-03T12:27:14+00:00
PHP: Irrelevant OS:  Package Version: 2.5.0b1

Description:
------------
I had some trouble today looping the results of MDB2::executeStoredProc() using MySQLi. I eventually got it to work using the pattern in the test script section. This example may be useful to add to the result documentation at http://pear.php.net/manual/en/package.database.mdb2.intro-fetch.php.

If you use the normal looping pattern, which is just the internal while loop, the result set will not be properly freed for MySQLi procedures. This causes out-of-sync errors when you call more than one procedure.

This behavior may be a bug, in which case the test script is merely a workaround.

Test script:
---------------
$rs = $db-&gt;executeStoredProcedure('procedureName', array('argument1'));

do {
    while ($row = $rs-&gt;fetchRow(MDB2_FETCHMODE_OBJECT)) {
        var_dump($row);
    }
} while ($rs-&gt;nextResult());</pre>]]></description>
      <dc:date>2008-06-03T12:27:14+00:00</dc:date>
      <dc:creator>mike &amp;#x61;&amp;#116; silverorange &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2 Documentation Problem</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13649">
      <title>MDB2: Bug 13649 [Open] queryAll doesn't free stored procedure result properly with mysqli driver</title>
      <link>http://pear.php.net/bugs/13649</link>
      <content:encoded><![CDATA[<pre>MDB2 Bug
Reported by ben
2008-04-11T03:05:58+00:00
PHP: Irrelevant OS: irrelevant Package Version: 2.4.1

Description:
------------
given $mdb2 is a valid mysqli connection :

$data = $mdb2-&gt;queryAll('CALL test.MyStoredProc()');
$data = $mdb2-&gt;queryAll('SELECT * FROM test.MyTable');
the second statement get &quot;out of sync&quot; error
this is a know problem see
http://amountaintop.com/php-5-and-mysql-5-stored-procedures-error-and-solution-qcodo
http://www.rooftopsolutions.nl/tag/mysqli

This is because a stored proc in mysql 5+ can return multiple resultset.

To solve this change line 3358 of MDB2.php file from :
$result-&gt;free();

to:
while($result-&gt;nextResult()) $result-&gt;free();

TODO : check others place in the code to correct.



Test script:
---------------
$data = $mdb2-&gt;queryAll('CALL test.MyStoredProc()');
$data = $mdb2-&gt;queryAll('SELECT * FROM test.MyTable');</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Bug
Reported by ben
2008-04-11T03:05:58+00:00
PHP: Irrelevant OS: irrelevant Package Version: 2.4.1

Description:
------------
given $mdb2 is a valid mysqli connection :

$data = $mdb2-&gt;queryAll('CALL test.MyStoredProc()');
$data = $mdb2-&gt;queryAll('SELECT * FROM test.MyTable');
the second statement get &quot;out of sync&quot; error
this is a know problem see
http://amountaintop.com/php-5-and-mysql-5-stored-procedures-error-and-solution-qcodo
http://www.rooftopsolutions.nl/tag/mysqli

This is because a stored proc in mysql 5+ can return multiple resultset.

To solve this change line 3358 of MDB2.php file from :
$result-&gt;free();

to:
while($result-&gt;nextResult()) $result-&gt;free();

TODO : check others place in the code to correct.



Test script:
---------------
$data = $mdb2-&gt;queryAll('CALL test.MyStoredProc()');
$data = $mdb2-&gt;queryAll('SELECT * FROM test.MyTable');</pre>]]></description>
      <dc:date>2008-04-11T03:05:58+00:00</dc:date>
      <dc:creator>benjamin &amp;#x64;&amp;#111;&amp;#x74; taieb &amp;#x61;&amp;#116; bnpparibas &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2 Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13389">
      <title>MDB2: Feature/Change Request 13389 [Open] LDAP Support</title>
      <link>http://pear.php.net/bugs/13389</link>
      <content:encoded><![CDATA[<pre>MDB2 Feature/Change Request
Reported by emgillis
2008-03-13T18:47:54+00:00
PHP: 5.2.1 OS: OS X Package Version: 2.4.1

Description:
------------
First of all, I think this package is awesome!

I would, however, like to see LDAP support included. If there is 
already, 
I apologize, but I could not find it in any documentation anywhere.
Ideally, it should have (at the very least) TLS, Bind, Compare, 
Abandon, 
and Unbind  -- basically the commands for doing search / select 
queries. 

If there was support for Create, Update, Delete options, that'd be 
spectacular.

Thanks!!!</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Feature/Change Request
Reported by emgillis
2008-03-13T18:47:54+00:00
PHP: 5.2.1 OS: OS X Package Version: 2.4.1

Description:
------------
First of all, I think this package is awesome!

I would, however, like to see LDAP support included. If there is 
already, 
I apologize, but I could not find it in any documentation anywhere.
Ideally, it should have (at the very least) TLS, Bind, Compare, 
Abandon, 
and Unbind  -- basically the commands for doing search / select 
queries. 

If there was support for Create, Update, Delete options, that'd be 
spectacular.

Thanks!!!</pre>]]></description>
      <dc:date>2008-04-07T17:06:43+00:00</dc:date>
      <dc:creator>emgillis &amp;#x61;&amp;#116; yahoo &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12157">
      <title>MDB2: Feature/Change Request 12157 [Open] Manager changeConstraint()</title>
      <link>http://pear.php.net/bugs/12157</link>
      <content:encoded><![CDATA[<pre>MDB2 Feature/Change Request
Reported by ifeghali
2007-09-30T23:09:55+00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
Currently MDB2_Schema doesn't handle schemas with multiple keys defined as a primary key (one being an auto increment field) because MDB2 lack the necessary tool to change a primary key. Please take a look at Bug #12154. Instead of a new method changeConstraint() another approach would be to detect inside createConstraint() when we are trying to create a PRIMARY KEY when one already exists, in this case MDB could assume that we want to replace this key.

Expected result:
----------------
Ability to perform such query:

ALTER TABLE `wp_options` DROP PRIMARY KEY , ADD PRIMARY KEY (
`option_id` , `blog_id` , `option_name` )</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Feature/Change Request
Reported by ifeghali
2007-09-30T23:09:55+00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
Currently MDB2_Schema doesn't handle schemas with multiple keys defined as a primary key (one being an auto increment field) because MDB2 lack the necessary tool to change a primary key. Please take a look at Bug #12154. Instead of a new method changeConstraint() another approach would be to detect inside createConstraint() when we are trying to create a PRIMARY KEY when one already exists, in this case MDB could assume that we want to replace this key.

Expected result:
----------------
Ability to perform such query:

ALTER TABLE `wp_options` DROP PRIMARY KEY , ADD PRIMARY KEY (
`option_id` , `blog_id` , `option_name` )</pre>]]></description>
      <dc:date>2007-09-30T23:09:55+00:00</dc:date>
      <dc:creator>ifeghali &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>MDB2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/11108">
      <title>MDB2: Feature/Change Request 11108 [Open] Consider a 'mock' driver for use in unit tests</title>
      <link>http://pear.php.net/bugs/11108</link>
      <content:encoded><![CDATA[<pre>MDB2 Feature/Change Request
Reported by doconnor
2007-05-23T08:55:03+00:00
PHP: 5.2.1 OS:  Package Version: 2.4.1

Description:
------------
Provide an mdb2 driver for mock database handling.

The best use case for this is in unit test frameworks like phpunit, or similar.

See http://pear.php.net/bugs/bug.php?id=11107 for the original RFE, aimed at PEAR::DB</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Feature/Change Request
Reported by doconnor
2007-05-23T08:55:03+00:00
PHP: 5.2.1 OS:  Package Version: 2.4.1

Description:
------------
Provide an mdb2 driver for mock database handling.

The best use case for this is in unit test frameworks like phpunit, or similar.

See http://pear.php.net/bugs/bug.php?id=11107 for the original RFE, aimed at PEAR::DB</pre>]]></description>
      <dc:date>2009-01-25T07:25:13+00:00</dc:date>
      <dc:creator>daniel &amp;#x64;&amp;#111;&amp;#x74; oconnor &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/9332">
      <title>MDB2: Feature/Change Request 9332 [Open] Customize prepared statement name</title>
      <link>http://pear.php.net/bugs/9332</link>
      <content:encoded><![CDATA[<pre>MDB2 Feature/Change Request
Reported by kailoran@...
2006-11-14T12:16:17+00:00
PHP: Irrelevant OS:  Package Version: 2.3.0

Description:
------------
It would be useful if prepare() took another argument that would be used to name the prepared statement instead of using $this-&gt;options['statement_format']. This would allow easy naming of individual statements without having to change the option every time and restoring it back afterwards.


Test script:
---------------
// One way of doing it:

/* in MDB2.php, change default options['statement_format'] to have a placeholder for a string, eg. */
'statement_format' =&gt; 'MDB2_STATEMENT%3$s_%1$s_%2$s'

/* change the definition of prepare() */
function &amp;prepare($query, $types = null, $result_types = null, $lobs = array(), $statement_name = '')


/* in the prepare() functions, use the new parameter */
...
    $statement_name = sprintf($this-&gt;options['statement_format'], $statement_name, $this-&gt;phptype, md5(time() + rand()), $statement_name);</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Feature/Change Request
Reported by kailoran@...
2006-11-14T12:16:17+00:00
PHP: Irrelevant OS:  Package Version: 2.3.0

Description:
------------
It would be useful if prepare() took another argument that would be used to name the prepared statement instead of using $this-&gt;options['statement_format']. This would allow easy naming of individual statements without having to change the option every time and restoring it back afterwards.


Test script:
---------------
// One way of doing it:

/* in MDB2.php, change default options['statement_format'] to have a placeholder for a string, eg. */
'statement_format' =&gt; 'MDB2_STATEMENT%3$s_%1$s_%2$s'

/* change the definition of prepare() */
function &amp;prepare($query, $types = null, $result_types = null, $lobs = array(), $statement_name = '')


/* in the prepare() functions, use the new parameter */
...
    $statement_name = sprintf($this-&gt;options['statement_format'], $statement_name, $this-&gt;phptype, md5(time() + rand()), $statement_name);</pre>]]></description>
      <dc:date>2006-11-14T12:16:17+00:00</dc:date>
      <dc:creator>kailoran &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/8413">
      <title>MDB2: Feature/Change Request 8413 [Open] ODBC driver</title>
      <link>http://pear.php.net/bugs/8413</link>
      <content:encoded><![CDATA[<pre>MDB2 Feature/Change Request
Reported by ariel.kempf@...
2006-08-10T14:48:44+00:00
PHP: 5.1.4 OS:  Package Version: 2.2.0

Description:
------------
I find very usefull to have an ODBC driver, like the one in the DB package.
Is it planned to have an ODBC driver like we have in DB?</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Feature/Change Request
Reported by ariel.kempf@...
2006-08-10T14:48:44+00:00
PHP: 5.1.4 OS:  Package Version: 2.2.0

Description:
------------
I find very usefull to have an ODBC driver, like the one in the DB package.
Is it planned to have an ODBC driver like we have in DB?</pre>]]></description>
      <dc:date>2007-12-09T15:57:38+00:00</dc:date>
      <dc:creator>ariel &amp;#x64;&amp;#111;&amp;#x74; kempf &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/6907">
      <title>MDB2: Feature/Change Request 6907 [Open] PDO based drivers (was: SQLite Version 3 Support)</title>
      <link>http://pear.php.net/bugs/6907</link>
      <content:encoded><![CDATA[<pre>MDB2 Feature/Change Request
Reported by priplatv@...
2006-02-23T10:24:06+00:00
PHP: 5.1.2 OS: Irrelevant Package Version: 

Description:
------------
Could you please let us know, whether it is the intention to support version 3 of SQLite within the DB package, together with version 2 obviously, and by when? With the bundled availability of SQLite Version 3 within PHP 5.x it would be a big advantage to have this support within PEAR, allowing developers to move to the latest (and better) version of SQLite easily.
Many thanks.</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2 Feature/Change Request
Reported by priplatv@...
2006-02-23T10:24:06+00:00
PHP: 5.1.2 OS: Irrelevant Package Version: 

Description:
------------
Could you please let us know, whether it is the intention to support version 3 of SQLite within the DB package, together with version 2 obviously, and by when? With the bundled availability of SQLite Version 3 within PHP 5.x it would be a big advantage to have this support within PEAR, allowing developers to move to the latest (and better) version of SQLite easily.
Many thanks.</pre>]]></description>
      <dc:date>2008-04-12T18:59:07+00:00</dc:date>
      <dc:creator>priplatv &amp;#x61;&amp;#116; netscape &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>MDB2 Feature/Change Request</dc:subject>
    </item>
</rdf:RDF>
