php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74244 Impossible to call stored procedure
Submitted: 2017-03-14 08:38 UTC Modified: 2018-08-27 09:28 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: vladimir dot drogovoz at leapfrogbuilders dot com Assigned: vnkbabu (profile)
Status: Closed Package: ibm_db2 (PECL)
PHP Version: 7.1.2 OS: Linux mint
Private report: No CVE-ID: None
 [2017-03-14 08:38 UTC] vladimir dot drogovoz at leapfrogbuilders dot com
Description:
------------
When I try call stored procedure from php7.1, I see few warnings and have no results
Warning: db2_execute(): Value Not Bound
Warning: db2_execute(): Binding Error 3

When I use php5.6 everything works fine

Test script:
---------------
$connect = $this->resource;
$queryStr = "call TEST.GET_ALL (?, ?)";

$stmt = db2_prepare($connect, $queryStr);

$id = 1;
$name = '';

db2_bind_param($stmt, 1, "id", DB2_PARAM_IN);
db2_bind_param($stmt, 2, "name", DB2_PARAM_OUT);

$result = db2_execute($stmt);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-13 11:11 UTC] vnkbabu@php.net
-Status: Open +Status: Assigned
 [2017-07-13 11:11 UTC] vnkbabu@php.net
Hi,
I have used the following testcase on php 7.1.7 on linux:
$conn = db2_connect($database, $user, $password);

if ($conn) {
        $queryStr = "call TEST (?, ?)";

$stmt = db2_prepare($conn, $queryStr);

$id = 1;
$name = 'test';

db2_bind_param($stmt, 1, "id", DB2_PARAM_IN);
db2_bind_param($stmt, 2, "name", DB2_PARAM_OUT);

$result = db2_execute($stmt);

echo $name;

--------

I see CALL statement is execute successfully, but how ever in php 7.1 while exiting the program i am seeing the following error.

hotellnx107: /home/vnkbabu> php b.php
abc -------------> output of the CALL statement.

[Thu Jul 13 07:08:56 2017]  Script:  '/home/hotellnx107/vnkbabu/b.php'
/home/vnkbabu/ibm_db2-cb16114/ibm_db2.c(4339) :  Freeing 0x00007ffff6281090 (16 bytes), script=/home/hotellnx107/vnkbabu/b.php
[Thu Jul 13 07:08:56 2017]  Script:  '/home/hotellnx107/vnkbabu/b.php'
/home/vnkbabu/phpbin/include/php/Zend/zend_string.h(122) :  Freeing 0x00007ffff628c4c0 (32 bytes), script=/home/hotellnx107/vnkbabu/b.php
=== Total 2 memory leaks detected ===

Looks like our driver is having some issues with db2_bind_param, our developer abhinav is looking into it. Will update once he fixes the issue.
 [2018-08-27 09:28 UTC] vnkbabu@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: vnkbabu
 [2018-08-27 09:28 UTC] vnkbabu@php.net
Can you please try with latest release. If issue still persist kindly reopen it.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Apr 09 08:01:23 2020 UTC