Bug #70302 [Opn->Fbk]: Parameter bind with OCI is broken - always last parameter value bound to all

From: Date: Thu, 20 Aug 2015 04:07:23 +0000
Subject: Bug #70302 [Opn->Fbk]: Parameter bind with OCI is broken - always last parameter value bound to all
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195363@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70302&edit=1 ID: 70302 Updated by: sixd@php.net Reported by: deepdiver at owncloud dot com Summary: Parameter bind with OCI is broken - always last parameter value bound to all -Status: Open +Status: Feedback Type: Bug Package: PDO OCI Operating System: Linux PHP Version: 7.0.0beta3 Block user comment: N Private report: N New Comment: Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Your subject says "OCI", the category says "PDO_OCI" but the sample code indicates you might mean OCI8. Can you clarify and also supply a runnable testcase that doesn't depend on any 3rd party code? If this is OCI8, is the problem related to one of the known diffs? Try running the test suite. Previous Comments: ------------------------------------------------------------------------ [2015-08-19 12:33:03] deepdiver at owncloud dot com Description: ------------ Query parameters are always bound to the value of the last parameter. See the test script below. Here is the out come with php 5.6: $ php test.php XDebug could not open the remote debug file '/tmp/xdebug.log'. array(1) { [0] => array(3) { 'A' => string(1) "1" 'B' => string(1) "2" 'C' => string(1) "3" } } With 7.0.0beta3: $ php --version PHP 7.0.0beta3 (cli) (built: Aug 17 2015 17:19:56) Copyright (c) 1997-2015 The PHP Group Zend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies deepdiver@alien:~/Development/ownCloud/php7-mysql$ php test.php array(1) { [0]=> array(3) { ["A"]=> string(1) "3" ["B"]=> string(1) "3" ["C"]=> string(1) "3" } } Test script: --------------- <?php require 'vendor/autoload.php'; $config = new \Doctrine\DBAL\Configuration(); //.. $connectionParams = array( 'dbname' => 'XE', 'user' => 'autotest', 'password' => 'owncloud', 'host' => '10.0.0.7', 'port' => 1521, 'driver' => 'oci8', ); $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); $conn->connect(); $conn->executeUpdate('DROP TABLE TEST'); $conn->executeUpdate('CREATE TABLE TEST(A VARCHAR2(4000) NOT NULL, B VARCHAR2(4000) NOT NULL, C VARCHAR2(4000) NOT NULL)'); $conn->insert('TEST', [ 'A' => '1', 'B' => '2', 'C' => '3']); $all = $conn->fetchAll('select * from TEST'); var_dump($all); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70302&edit=1

« previous php.bugs (#195363) next »