php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72169 db2_bind_param variable dereferencing
Submitted: 2016-05-05 22:05 UTC Modified: 2018-08-27 09:55 UTC
Votes:4
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:0 (0.0%)
From: jtremblay at groupetranswest dot com Assigned: vnkbabu (profile)
Status: Closed Package: ibm_db2 (PECL)
PHP Version: 7.0.6 OS: Ubuntu 16.04
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jtremblay at groupetranswest dot com
New email:
PHP Version: OS:

 

 [2016-05-05 22:05 UTC] jtremblay at groupetranswest dot com
Description:
------------
db2_bind_param function seems to be unable to bind to referenced variables under PHP 7.0.4.

Installed is the ibm_db2 package 1.9.9.

This was tested with various DB2 client drivers 9.5, 9.7fp9, 9.7fp11 under both PHP 5.x and PHP 7.0.4... Only the latest PHP presents with this issue.

This worked fine under PHP 5.x.


Test script:
---------------
$connection_string = 'DRIVER={IBM DB2 ODBC DRIVER};DATABASE=MYDB;HOSTNAME=127.0.0.1;PORT=50000;PROTOCOL=TCPIP;UID=someuser;PWD=somepwd;';
$conn              = db2_connect($connection_string, '', '', array('trustedcontext' => DB2_TRUSTED_CONTEXT_ENABLE));
$sql               = "CALL MYSCHEMA.MYFUNCTION( ? )";
$stmt              = db2_prepare($conn, $sql);
$id                = 1;
$result            =& $id;
$bind              = db2_bind_param($stmt, 1, "result", DB2_PARAM_OUT);
$ex                = db2_execute($stmt);

var_dump($result);


Expected result:
----------------
int(24663)

Actual result:
--------------
PHP Warning:  db2_execute(): Binding Error 1 in /data/www/tw-intra/public_html/scripts/testDb2Calls.php on line 19
PHP Stack trace:
PHP   1. {main}() /data/www/scripts/testDb2Calls.php:0
PHP   2. db2_execute() /data/www/scripts/testDb2Calls.php:19
PHP Warning:  db2_execute(): Binding Error 3 in /data/www/scripts/testDb2Calls.php on line 19
PHP Stack trace:
PHP   1. {main}() /data/www/scripts/testDb2Calls.php:0
PHP   2. db2_execute() /data/www/scripts/testDb2Calls.php:19
/data/www/scripts/testDb2Calls.php:21:
int(1)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-13 11:22 UTC] vnkbabu@php.net
-Status: Open +Status: Assigned
 [2017-07-13 11:22 UTC] vnkbabu@php.net
-Status: Open +Status: Assigned
 [2017-07-13 11:22 UTC] vnkbabu@php.net
Sorry for the late reply. Our developer abhinav has started working on the fix. will update soon with the fix.
 [2017-07-13 11:24 UTC] vnkbabu@php.net
-Status: Open +Status: Assigned
 [2017-07-13 11:24 UTC] vnkbabu@php.net
Sorry for the late reply. this bug slipped from our list due to other work. Our developer has started working on the fix. Will update once we found the fix.
 [2017-09-29 13:33 UTC] vnkbabu@php.net
We have released a new version(2.0.0) with number of defect fix.Please reopen the defect again if you are still seeing this issue.
 [2018-08-27 09:55 UTC] vnkbabu@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: vnkbabu
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 13:01:24 2019 UTC