php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77181 PDO Statement is not reusable after closing cursor on PDO OCI
Submitted: 2018-11-20 14:59 UTC Modified: -
From: morozov at tut dot by Assigned:
Status: Open Package: PDO OCI
PHP Version: 7.2.12 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: morozov at tut dot by
New email:
PHP Version: OS:

 

 [2018-11-20 14:59 UTC] morozov at tut dot by
Description:
------------
According to the documentation PDOStatement::closeCursor() […] leaves the statement in a state that enables it to be executed again. The example below works at least with pdo_mysql, pdo_sqlite and pdo_pgsql but doesn't work with pdo_oci.

Test script:
---------------
$conn = new PDO(
    'oci:dbname=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=XE)))',
    'system',
    'oracle'
);

$stmt = $conn->prepare('SELECT ? FROM DUAL');
$stmt->execute([1]);
$value = $stmt->fetchColumn();
var_dump($value);

$stmt->closeCursor();

$stmt->execute([2]);
$value = $stmt->fetchColumn();
var_dump($value);


Expected result:
----------------
string(1) "1"
string(1) "2"

Actual result:
--------------
string(1) "1"
NULL


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Thu Dec 13 08:01:25 2018 UTC