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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu May 16 01:01:33 2024 UTC