Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #41997 : Stored procedure call that returns a single rowset blocks future queries
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 31st July 23:24
php-bugs
External User
 
Posts: 1
Default #41997 : Stored procedure call that returns a single rowset blocks future queries



From: nitel_defect at yahoo dot com
Operating system: Windows XP SP2
PHP version: 5.2.3
PHP Bug Type: PDO related
Bug description: Stored procedure call that returns a single rowset blocks future queries

Description:
------------
The code below calls a stored procedure that fethches the whole tree in a
father-son system roles hierarchy.
In the end, the stored procedure selects everything from a temp table, so
that's our result set.
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY is on by default.
After running the call statement, all the result rows are returned
correctly but any future query (not only other calls, all queries) fail
with the message you see below.
For the time being I replicated the code I needed in PHP, but it's
frustrating not to be able to run SPs...
I tested the library found here:
http://source.hackthissite.org/svn/trunk/PDO/php_pdo_mysql.dll
and this bug was gone. But there is no source code for this modified
library and its size is much smaller so I don't quite trust it.
Uhm... help?

Reproduce code:
---------------
<?php
$db = new PDO('mysql:host=localhost;dbname=2m;port=3306', 'root', '',
array());
$st = $db->query("call getParentRoles('admin')");
do {
$rows = $st->fetchAll(PDO::FETCH_ASSOC);
} while ($st->nextRowset());
$st->closeCursor();
var_dump($db->errorInfo());
echo '<br />';
$st = $db->query("SELECT * FROM user");
var_dump($db->errorInfo());

Expected result:
----------------
array(1) { [0]=> string(5) "00000" }
array(1) { [0]=> string(5) "00000" }

Actual result:
--------------
array(1) { [0]=> string(5) "00000" }
array(3) { [0]=> string(5) "HY000" [1]=> int(2014) [2]=> string(269)
"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 bug report at http://bugs.php.net/?id=41997&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41997&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41997&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41997&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41997&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41997&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41997&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41997&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41997&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41997&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41997&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41997&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41997&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41997&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41997&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41997&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41997&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41997&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41997&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41997&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41997&r=mysqlcfg
  Reply With Quote


  sponsored links


2 1st August 05:31
php-bugs
External User
 
Posts: 1
Default #41997 : Stored procedure call that returns a single rowset blocks future queries



ID: 41997
Comment by: temposeb at free dot fr
Reported By: nitel_defect at yahoo dot com
Status: Open
Bug Type: PDO related
Operating System: Windows XP SP2
PHP Version: 5.2.3
New Comment:

I encounter exactly the same bug for many months.
Environment : Win2000 Pro SP4, Apache 2.2, PHP 5.2.4-dev (Build Date
Jul 11 2007 20:03:23), MySQL 5.1.20-beta-community-nt-debug (same thing
with MySQL 5.0.x).
nitel_defect, where can we find the hacked DLL ?
http://source.hackthissite.org/svn/trunk/PDO/php_pdo_mysql.dll is
actually DOWN. Thx.


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

[2007-07-15 06:53:01] nitel_defect at yahoo dot com

Description:
------------
The code below calls a stored procedure that fethches the whole tree in
a father-son system roles hierarchy.
In the end, the stored procedure selects everything from a temp table,
so that's our result set.
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY is on by default.
After running the call statement, all the result rows are returned
correctly but any future query (not only other calls, all queries) fail
with the message you see below.
For the time being I replicated the code I needed in PHP, but it's
frustrating not to be able to run SPs...
I tested the library found here:
http://source.hackthissite.org/svn/trunk/PDO/php_pdo_mysql.dll
and this bug was gone. But there is no source code for this modified
library and its size is much smaller so I don't quite trust it.
Uhm... help?

Reproduce code:
---------------
<?php
$db = new PDO('mysql:host=localhost;dbname=2m;port=3306', 'root', '',
array());
$st = $db->query("call getParentRoles('admin')");
do {
$rows = $st->fetchAll(PDO::FETCH_ASSOC);
} while ($st->nextRowset());
$st->closeCursor();
var_dump($db->errorInfo());
echo '<br />';
$st = $db->query("SELECT * FROM user");
var_dump($db->errorInfo());

Expected result:
----------------
array(1) { [0]=> string(5) "00000" }
array(1) { [0]=> string(5) "00000" }

Actual result:
--------------
array(1) { [0]=> string(5) "00000" }
array(3) { [0]=> string(5) "HY000" [1]=> int(2014) [2]=> string(269)
"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=41997&edit=1
  Reply With Quote
3 1st August 05:31
php-bugs
External User
 
Posts: 1
Default #41997 : Stored procedure call that returns a single rowset blocks future queries


ID: 41997
User updated by: nitel_defect at yahoo dot com
Reported By: nitel_defect at yahoo dot com
Status: Open
Bug Type: PDO related
Operating System: Windows XP SP2
PHP Version: 5.2.3
New Comment:

http://www.kpsol.ro/php_pdo_mysql.dll


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

[2007-07-16 17:30:00] temposeb at free dot fr

I encounter exactly the same bug for many months.
Environment : Win2000 Pro SP4, Apache 2.2, PHP 5.2.4-dev (Build Date
Jul 11 2007 20:03:23), MySQL 5.1.20-beta-community-nt-debug (same thing
with MySQL 5.0.x).
nitel_defect, where can we find the hacked DLL ?
http://source.hackthissite.org/svn/trunk/PDO/php_pdo_mysql.dll is
actually DOWN. Thx.

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

[2007-07-15 06:53:01] nitel_defect at yahoo dot com

Description:
------------
The code below calls a stored procedure that fethches the whole tree in
a father-son system roles hierarchy.
In the end, the stored procedure selects everything from a temp table,
so that's our result set.
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY is on by default.
After running the call statement, all the result rows are returned
correctly but any future query (not only other calls, all queries) fail
with the message you see below.
For the time being I replicated the code I needed in PHP, but it's
frustrating not to be able to run SPs...
I tested the library found here:
http://source.hackthissite.org/svn/trunk/PDO/php_pdo_mysql.dll
and this bug was gone. But there is no source code for this modified
library and its size is much smaller so I don't quite trust it.
Uhm... help?

Reproduce code:
---------------
<?php
$db = new PDO('mysql:host=localhost;dbname=2m;port=3306', 'root', '',
array());
$st = $db->query("call getParentRoles('admin')");
do {
$rows = $st->fetchAll(PDO::FETCH_ASSOC);
} while ($st->nextRowset());
$st->closeCursor();
var_dump($db->errorInfo());
echo '<br />';
$st = $db->query("SELECT * FROM user");
var_dump($db->errorInfo());

Expected result:
----------------
array(1) { [0]=> string(5) "00000" }
array(1) { [0]=> string(5) "00000" }

Actual result:
--------------
array(1) { [0]=> string(5) "00000" }
array(3) { [0]=> string(5) "HY000" [1]=> int(2014) [2]=> string(269)
"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=41997&edit=1
  Reply With Quote
4 3rd August 23:07
php-bugs
External User
 
Posts: 1
Default #41997 : Stored procedure call that returns a single rowset blocks future queries


ID: 41997
Comment by: marpiotr at gmail dot com
Reported By: nitel_defect at yahoo dot com
Status: Open
Bug Type: PDO related
Operating System: Windows XP SP2
PHP Version: 5.2.3
New Comment:

i seem to have the same problem on 5.1.6 on Fedora Core 6


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

[2007-07-16 18:06:49] nitel_defect at yahoo dot com

http://www.kpsol.ro/php_pdo_mysql.dll

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

[2007-07-16 17:30:00] temposeb at free dot fr

I encounter exactly the same bug for many months.
Environment : Win2000 Pro SP4, Apache 2.2, PHP 5.2.4-dev (Build Date
Jul 11 2007 20:03:23), MySQL 5.1.20-beta-community-nt-debug (same thing
with MySQL 5.0.x).
nitel_defect, where can we find the hacked DLL ?
http://source.hackthissite.org/svn/trunk/PDO/php_pdo_mysql.dll is
actually DOWN. Thx.

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

[2007-07-15 06:53:01] nitel_defect at yahoo dot com

Description:
------------
The code below calls a stored procedure that fethches the whole tree in
a father-son system roles hierarchy.
In the end, the stored procedure selects everything from a temp table,
so that's our result set.
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY is on by default.
After running the call statement, all the result rows are returned
correctly but any future query (not only other calls, all queries) fail
with the message you see below.
For the time being I replicated the code I needed in PHP, but it's
frustrating not to be able to run SPs...
I tested the library found here:
http://source.hackthissite.org/svn/trunk/PDO/php_pdo_mysql.dll
and this bug was gone. But there is no source code for this modified
library and its size is much smaller so I don't quite trust it.
Uhm... help?

Reproduce code:
---------------
<?php
$db = new PDO('mysql:host=localhost;dbname=2m;port=3306', 'root', '',
array());
$st = $db->query("call getParentRoles('admin')");
do {
$rows = $st->fetchAll(PDO::FETCH_ASSOC);
} while ($st->nextRowset());
$st->closeCursor();
var_dump($db->errorInfo());
echo '<br />';
$st = $db->query("SELECT * FROM user");
var_dump($db->errorInfo());

Expected result:
----------------
array(1) { [0]=> string(5) "00000" }
array(1) { [0]=> string(5) "00000" }

Actual result:
--------------
array(1) { [0]=> string(5) "00000" }
array(3) { [0]=> string(5) "HY000" [1]=> int(2014) [2]=> string(269)
"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=41997&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666