Bug #70302 [NEW]: Parameter bind with OCI is broken - always last parameter value bound to all
| From: | deepdiver at owncloud dot com | Date: | Wed, 19 Aug 2015 12:33:08 +0000 |
| Subject: | Bug #70302 [NEW]: Parameter bind with OCI is broken - always last parameter value bound to all | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-195332@lists.php.net to get a copy of this message | ||
From: deepdiver at owncloud dot com
Operating system: Linux
PHP version: 7.0.0beta3
Package: PDO OCI
Bug Type: Bug
Bug description:Parameter bind with OCI is broken - always last parameter value bound to all
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 bug report at https://bugs.php.net/bug.php?id=70302&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70302&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70302&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70302&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70302&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70302&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70302&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70302&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70302&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70302&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70302&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70302&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70302&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70302&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70302&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70302&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70302&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70302&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70302&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70302&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70302&r=mysqlcfg