ID:               34499
 Updated by:       [EMAIL PROTECTED]
 Reported By:      maesa at email dot it
-Status:           Open
+Status:           Feedback
 Bug Type:         PDO related
 Operating System: Windows XP SP2
 PHP Version:      5.1.0RC1
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

Several fixes were committed since RC1 was released..



Previous Comments:
------------------------------------------------------------------------

[2005-09-14 11:44:34] maesa at email dot it

Description:
------------
A pdo::exec call fails when i try to execute sequential query (
'OPTIMIZE TABLE' queries )

Reproduce code:
---------------
$dsn = 'mysql:dbname=my_database;host=localhost';
$user = 'root';
$password = '';

try {
   $dbh = new PDO($dsn, $user, $password);
} catch (PDOException $e) {
   echo 'Connection failed: ' . $e->getMessage();
}

$dbh->exec( 'OPTIMIZE TABLE my_table' );
print_r($dbh->errorInfo());

$dbh->exec( 'OPTIMIZE TABLE my_table_1' );
print_r($dbh->errorInfo());

Expected result:
----------------
I expected that the second call to $dbh->exec will be successful as the
first one, but the second fails.

Actual result:
--------------
Printing the array returned from $dbh->errorInfo() i obtain for the
first call to pdo::exec 

Array
(
    [0] => 00000
)

but for the second call


Array
(
    [0] => HY000
    [1] => 2014
    [2] => Cannot execute queries while other unbuffered queries are
active.  Consider using PDOStatement::fetchAll().  Alternatively, if
your code is only ever going to run against mysql, you may enable query
buffering by setting the PDO_MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
)


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=34499&edit=1

Reply via email to