php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64999 Calling stored procedure with multiple out params crashes php
Submitted: 2013-06-09 09:15 UTC Modified: 2021-09-12 04:22 UTC
Votes:5
Avg. Score:4.8 ± 0.4
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:4 (100.0%)
From: rahul dot priyadarshi at in dot ibm dot com Assigned: vnkbabu (profile)
Status: No Feedback Package: PDO_IBM (PECL)
PHP Version: 5.4.16 OS: redhat el5
Private report: No CVE-ID: None
 [2013-06-09 09:15 UTC] rahul dot priyadarshi at in dot ibm dot com
Description:
------------
Linux app server running php 5.4.16 and pdo_ibm-1.3.3, connecting to db2 connect, 
which then connects to db2 server.

The code included makes php just crash with no errors, just totally dies with zero 
output. From all the troubleshooting and narrowing down to this code, all I can 
figure is that it is something to do with multiple out parameters. We can call 
sprocs with single out parameters fine. The same code also works in php 5.3 branch 
with same pdo_ibm-1.3.3, so something in pdo? must have changed in 5.4?

Also, just to be clear, changing the data type to 
PDO::PARAM_STR|PDO::PARAM_INTPUT_OUTPUT, adding a size parameter, trying 
PARAM_INT, none of the combinations I could think of make any difference.

Test script:
---------------
// MY_SPROC(inparam, inparam, outparam, outparam)
$input1 = 123;
$input2 = "Hello";
$output1 = "";
$output2 = "";

$sql = "CALL MY_SPROC(?, ?, ?, ?)";
$stmt = $db->prepare($sql);
$stmt->bindParam(1, $input1, PDO::PARAM_STR);
$stmt->bindParam(2, $input2, PDO::PARAM_STR);
$stmt->bindParam(3, $output1, PDO::PARAM_STR);
$stmt->bindParam(4, $output2, PDO::PARAM_STR);

$stmt->execute();

Expected result:
----------------
I expect $output1 and $output2 to be populated and not crash.

Actual result:
--------------
PHP just crashes with no output

Patches

bug_64999.patch (last revision 2013-07-24 17:24 UTC by rahulpriyadarshi@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-10 11:25 UTC] rahulpriyadarshi@php.net
-: brlamb at starbucks dot com +: rahul dot priyadarshi at in dot ibm dot com -Status: Open +Status: Assigned -Assigned To: +Assigned To: rahulpriyadarshi
 [2013-06-10 11:25 UTC] rahulpriyadarshi@php.net
I am looking into this issue, I will contact you if I get any difficulty in reproduction of this issue on my environment
 [2013-07-04 04:10 UTC] brlamb at starbucks dot com
I also confirmed this still crashes in PHP 5.5.0 using same PDO_IBM-1.3.3.
 [2013-07-24 17:24 UTC] rahulpriyadarshi@php.net
The following patch has been added/updated:

Patch Name: bug_64999.patch
Revision:   1374686677
URL:        https://bugs.php.net/patch-display.php?bug=64999&patch=bug_64999.patch&revision=1374686677
 [2013-07-24 17:26 UTC] rahulpriyadarshi@php.net
I have created a patch(bug_64999.patch) for this defect. It is working fine with my environment please test it in your environment and let me know how it works.
 [2014-04-28 01:16 UTC] brlamb at starbucks dot com
We have been running this patch for months and this fixed the issue for PHP 5.4 as well as PHP 5.5
 [2016-02-07 15:44 UTC] rahulpriyadarshi@php.net
-Assigned To: rahulpriyadarshi +Assigned To: vnkbabu
 [2021-08-31 16:10 UTC] cmb@php.net
-Status: Assigned +Status: Feedback
 [2021-08-31 16:10 UTC] cmb@php.net
What's the status here?  Has the patch ever been merged?
 [2021-09-12 04:22 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Nov 12 19:01:28 2024 UTC