php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44289 Output parameter not set if stored procedure returns rows
Submitted: 2008-02-29 10:40 UTC Modified: 2009-09-29 19:54 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: d at tpyo dot net Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.2.5 OS: Linux 2.6.22
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: d at tpyo dot net
New email:
PHP Version: OS:

 

 [2008-02-29 10:40 UTC] d at tpyo dot net
Description:
------------
It seems that if a stored procedure returns rows from a SELECT the output parameters are lost.

Not sure if this is the intended behaviour, but since this works fine from the MySQL CLI I'm inclined to believe it's not.

Reproduce code:
---------------
Stored procedures and PDO code for reproducing the problem:

http://undesigned.org.za/files/pdo-issue.phps


Expected result:
----------------
PDO_FOUND_ROWS_TEST_1(@test1): string(4) "Set!"
PDO_FOUND_ROWS_TEST_2(@test2): string(4) "Set!"


Actual result:
--------------
PDO_FOUND_ROWS_TEST_1(@test1): string(4) "Set!"
PDO_FOUND_ROWS_TEST_2(@test2): FAILED


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-25 14:55 UTC] jani@php.net
Please try using this CVS snapshot:

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

  http://windows.php.net/snapshots/


 [2009-05-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-09-29 19:54 UTC] uw@php.net
There is no bug here. 

You are not fetching the results from the SP and thus you get a 2014/Commands ouf of sync (http://dev.mysql.com/doc/refman/5.1/en/error-messages-client.html). The error gets reported through stmt->errorInfo(), as it should, when running SELECT @test2. 

You must fetch the results from the SP and close the statement before you can run a new query on the line. 

 
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 13:01:28 2025 UTC