Bug #73206 [Opn->Dup]: oci_bind_by_name/oci_execute doesn't work properly
| From: | sixd@php.net | Date: | Thu, 13 Oct 2016 04:46:42 +0000 |
| Subject: | Bug #73206 [Opn->Dup]: oci_bind_by_name/oci_execute doesn't work properly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-204656@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73206&edit=1
ID: 73206
Updated by: sixd@php.net
Reported by: sergei dot solomonov at gmail dot com
Summary: oci_bind_by_name/oci_execute doesn't work properly
-Status: Open
+Status: Duplicate
Type: Bug
Package: OCI8 related
Operating System: Ubuntu 15.04
PHP Version: 7.1.0RC3
Block user comment: N
Private report: N
New Comment:
Seems fixed by the patch in bug #71148.
Previous Comments:
------------------------------------------------------------------------
[2016-09-30 02:58:25] sergei dot solomonov at gmail dot com
Description:
------------
Tested with 7.09 and 7.1.0RC3 on Ubuntu 15.04.
Default php.ini-development config was used.
Configure command:
'./configure' '--enable-zip' '--enable-intl' '--with-oci8'
'--enable-dbase' '--disable-cgi'
'--with-apxs2=/usr/local/apache/bin/apxs' '--enable-opcache'
'--enable-sigchild' '--enable-mbstring' '--with-xsl'
'--with-gd' '--with-config-file-scan-dir=/usr/local/apache/conf'
'--with-openssl' '--with-curl' '--with-zlib'
'--enable-timezonedb'
Example below leads to incorrect result. In case bind value 8 or more chars length returns
false, if less than 8 - returns correct result.
It may be related with https://bugs.php.net/bug.php?id=73085.
For now, its impossible to work with PHP 7 and Oracle DB looks very unstable and buggy. Can't
use any php7 version in prod.
Test script:
---------------
class Statement {
public $resource;
function __construct($sql) {
$conn = oci_connect(getenv('db_login'), getenv('db_pwd'),
getenv('db_host'));
$this->resource = oci_parse($conn, $sql);
}
public function errorHandler($severity, $message, $file = '', $line = 0) {
var_dump($message, 0, $severity, $file, $line);
}
function execute() {
set_error_handler([$this, 'errorHandler']);
oci_execute($this->resource);
restore_error_handler();
}
function bindParams(array $bindParams = []) {
foreach ($bindParams as $bvn => &$bvv) {
oci_bind_by_name($this->resource, $bvn, $bvv);
}
}
function fetch() {
return oci_fetch_array($this->resource);
}
}
$stmt = new Statement("select * from dual where :param = 'xxxxxxxx'");
$stmt->bindParams(['param' => 'xxxxxxxx']);
$stmt->execute();
var_dump($stmt->fetch());
Expected result:
----------------
array(2) {
[0]=>
string(1) "X"
["DUMMY"]=>
string(1) "X"
}
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73206&edit=1