<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=MDB2_Driver_oci8</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/18719" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17354" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16246" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15922" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/18719">
      <title>MDB2_Driver_oci8: Bug 18719 [Open] ocisetprefetch called after OCIExecute</title>
      <link>http://pear.php.net/bugs/18719</link>
      <content:encoded><![CDATA[<pre>MDB2_Driver_oci8 Bug
Reported by thompsa
2011-08-12T04:09:16+00:00
PHP: 5.3.6 OS: FreeBSD 9.0 Package Version: SVN

Description:
------------
The PHP manual page for oci_set_prefetch() explicitly states it must be called before oci_execute(). In MDB2_Driver_oci8 (and the old pear:db too) the prefetch is set after execute, is this intentional or an oversight?</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Driver_oci8 Bug
Reported by thompsa
2011-08-12T04:09:16+00:00
PHP: 5.3.6 OS: FreeBSD 9.0 Package Version: SVN

Description:
------------
The PHP manual page for oci_set_prefetch() explicitly states it must be called before oci_execute(). In MDB2_Driver_oci8 (and the old pear:db too) the prefetch is set after execute, is this intentional or an oversight?</pre>]]></description>
      <dc:date>2011-08-12T04:09:16+00:00</dc:date>
      <dc:creator>andy &amp;#x61;&amp;#116; fud &amp;#x64;&amp;#111;&amp;#x74; org &amp;#x64;&amp;#111;&amp;#x74; nz</dc:creator>
      <dc:subject>MDB2_Driver_oci8 Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17354">
      <title>MDB2_Driver_oci8: Feature/Change Request 17354 [Open] Timestamp fields should also have ISO date format</title>
      <link>http://pear.php.net/bugs/17354</link>
      <content:encoded><![CDATA[<pre>MDB2_Driver_oci8 Feature/Change Request
Reported by koto
2010-04-28T19:12:31+00:00
PHP: Irrelevant OS:  Package Version: 1.4.1

Description:
------------
When connecting to database in function _doConnect() with default settings, date format for datetime fields is set to ISO:
ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'

However, timestamp fields retain their default format depending on server-side set locale. To prevent that, one should also issue query:

ALTER SESSION SET NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SS'

This query should be placed in _doConnect() method right next to the previous one. This is a short few-line change that would help everyone dealing with timestamp fields in Oracle (as now they can be safely altered/read/parsed with MDB2_Date )</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Driver_oci8 Feature/Change Request
Reported by koto
2010-04-28T19:12:31+00:00
PHP: Irrelevant OS:  Package Version: 1.4.1

Description:
------------
When connecting to database in function _doConnect() with default settings, date format for datetime fields is set to ISO:
ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'

However, timestamp fields retain their default format depending on server-side set locale. To prevent that, one should also issue query:

ALTER SESSION SET NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SS'

This query should be placed in _doConnect() method right next to the previous one. This is a short few-line change that would help everyone dealing with timestamp fields in Oracle (as now they can be safely altered/read/parsed with MDB2_Date )</pre>]]></description>
      <dc:date>2010-04-28T19:12:31+00:00</dc:date>
      <dc:creator>kkotowicz &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2_Driver_oci8 Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16246">
      <title>MDB2_Driver_oci8: Bug 16246 [Open] bindParam doesnt work with out params under oci8</title>
      <link>http://pear.php.net/bugs/16246</link>
      <content:encoded><![CDATA[<pre>MDB2_Driver_oci8 Bug
Reported by hannibal218
2009-05-21T16:35:47+00:00
PHP: 5.2.9 OS: centos 5.2 64bit Package Version: 

Description:
------------
if you try to call a stored procedure under mdb2 oci8, and that procedure has out params. you dont get the out params back.

i think that this actually breaks into two seperate problems.
the first one is that the calls to @OCIBindByName are missing a third variable that gives the size of the expected return value.  if , i changed localy :
if (!@OCIBindByName($this-&gt;statement, ':'.$parameter, $quoted_values[$i])) {
to :
if(!@OCIBindByName($this-&gt;statement, ':'.$parameter, $quoted_values[$i],32))

this gave me the out param values stored inside the $quoted_values array, this leads me to the second bug:

quoted_values is lost inside the function, its data is not added to the object returned by function my solution which is bad, was to add a third reference parameter to the _execute function, to hold that array :
&amp;_execute($result_class = true, $result_wrap_class = false , &amp;$result_params = array())


Test script:
---------------
  2 &lt;?php
  3 require_once &quot;MDB2.php&quot;;
  4
  5 /*
  6 //sayHello syntax
  7 CREATE OR REPLACE PROCEDURE
  8         sayHello (name IN VARCHAR2, greeting OUT VARCHAR2)
  9             AS
 10                 BEGIN
 11                     greeting := 'Hello ' || name;
 12                 END;
 13
 14 */
 15
 16
 17 $sql = 'begin sayHello(:inName, :inMessage); end;';
 18 $name = &quot;dor&quot;;
 19 $connStr = &quot;oci8://dispatcher:daparISZ@localhost/vcdb.videocells.com&quot;;
 20 echo &quot; ****************** OCI_INTERFACE **************** &lt;BR&gt;&quot;;
 21
 22 $conn = oci_connect(&quot;dispatcher&quot;,&quot;daparISZ&quot;,&quot;localhost/vcdb.videocells.com&quot;);
 23 $stmt = oci_parse($conn,$sql);
 24 oci_bind_by_name($stmt,':inName',$name,32);
 25 oci_bind_by_name($stmt,':inMessage',$message_OCI,32);
 26 oci_execute($stmt);
 27 echo &quot;message_OCI = $message_OCI &lt;br&gt;&quot;;
 28
 29 echo &quot; ****************** OCI_INTERFACE_END *********** &lt;BR&gt;&quot;;
 30 echo &quot; ****************** MDB_INTERFACE_START ********* &lt;BR&gt;&quot;;
 31 $mdb2 =&amp; MDB2::connect($connStr);
 32 if (PEAR::isError($mdb2))
 33 {
 34     die(__FILE__ .&quot; &quot;. __LINE__ .&quot; : &quot;. $mdb2-&gt;getMessage());
 35 }
 36
 37 $mdb2-&gt;setFetchMode(MDB2_FETCHMODE_ASSOC);
 38 $mdb2-&gt;LoadModule('Extended');
 39
 40 $statement = $mdb2-&gt;prepare($sql);
 41 $statement-&gt;bindParam(&quot;inName&quot;,$name);
 42 $statement-&gt;bindParam(&quot;inMessage&quot;,$message_MDB);
 43 $res = $statement-&gt;execute();
 44 echo &quot;message_MDB = $message_MDB &lt;br&gt;&quot;;
 45 $statement-&gt;free();
 46 echo &quot; ***************** MDB_INTERFACE_END *********** &lt;BR&gt;&quot;;
 47
 48 ?&gt;
 49


Expected result:
----------------
****************** OCI_INTERFACE ****************
message_OCI = Hello dor
****************** OCI_INTERFACE_END ***********
****************** MDB_INTERFACE_START *********
message_MDB = Hello dor 
***************** MDB_INTERFACE_END *********** 

Actual result:
--------------
****************** OCI_INTERFACE ****************
message_OCI = Hello dor
****************** OCI_INTERFACE_END ***********
****************** MDB_INTERFACE_START *********
message_MDB =
***************** MDB_INTERFACE_END ***********</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Driver_oci8 Bug
Reported by hannibal218
2009-05-21T16:35:47+00:00
PHP: 5.2.9 OS: centos 5.2 64bit Package Version: 

Description:
------------
if you try to call a stored procedure under mdb2 oci8, and that procedure has out params. you dont get the out params back.

i think that this actually breaks into two seperate problems.
the first one is that the calls to @OCIBindByName are missing a third variable that gives the size of the expected return value.  if , i changed localy :
if (!@OCIBindByName($this-&gt;statement, ':'.$parameter, $quoted_values[$i])) {
to :
if(!@OCIBindByName($this-&gt;statement, ':'.$parameter, $quoted_values[$i],32))

this gave me the out param values stored inside the $quoted_values array, this leads me to the second bug:

quoted_values is lost inside the function, its data is not added to the object returned by function my solution which is bad, was to add a third reference parameter to the _execute function, to hold that array :
&amp;_execute($result_class = true, $result_wrap_class = false , &amp;$result_params = array())


Test script:
---------------
  2 &lt;?php
  3 require_once &quot;MDB2.php&quot;;
  4
  5 /*
  6 //sayHello syntax
  7 CREATE OR REPLACE PROCEDURE
  8         sayHello (name IN VARCHAR2, greeting OUT VARCHAR2)
  9             AS
 10                 BEGIN
 11                     greeting := 'Hello ' || name;
 12                 END;
 13
 14 */
 15
 16
 17 $sql = 'begin sayHello(:inName, :inMessage); end;';
 18 $name = &quot;dor&quot;;
 19 $connStr = &quot;oci8://dispatcher:daparISZ@localhost/vcdb.videocells.com&quot;;
 20 echo &quot; ****************** OCI_INTERFACE **************** &lt;BR&gt;&quot;;
 21
 22 $conn = oci_connect(&quot;dispatcher&quot;,&quot;daparISZ&quot;,&quot;localhost/vcdb.videocells.com&quot;);
 23 $stmt = oci_parse($conn,$sql);
 24 oci_bind_by_name($stmt,':inName',$name,32);
 25 oci_bind_by_name($stmt,':inMessage',$message_OCI,32);
 26 oci_execute($stmt);
 27 echo &quot;message_OCI = $message_OCI &lt;br&gt;&quot;;
 28
 29 echo &quot; ****************** OCI_INTERFACE_END *********** &lt;BR&gt;&quot;;
 30 echo &quot; ****************** MDB_INTERFACE_START ********* &lt;BR&gt;&quot;;
 31 $mdb2 =&amp; MDB2::connect($connStr);
 32 if (PEAR::isError($mdb2))
 33 {
 34     die(__FILE__ .&quot; &quot;. __LINE__ .&quot; : &quot;. $mdb2-&gt;getMessage());
 35 }
 36
 37 $mdb2-&gt;setFetchMode(MDB2_FETCHMODE_ASSOC);
 38 $mdb2-&gt;LoadModule('Extended');
 39
 40 $statement = $mdb2-&gt;prepare($sql);
 41 $statement-&gt;bindParam(&quot;inName&quot;,$name);
 42 $statement-&gt;bindParam(&quot;inMessage&quot;,$message_MDB);
 43 $res = $statement-&gt;execute();
 44 echo &quot;message_MDB = $message_MDB &lt;br&gt;&quot;;
 45 $statement-&gt;free();
 46 echo &quot; ***************** MDB_INTERFACE_END *********** &lt;BR&gt;&quot;;
 47
 48 ?&gt;
 49


Expected result:
----------------
****************** OCI_INTERFACE ****************
message_OCI = Hello dor
****************** OCI_INTERFACE_END ***********
****************** MDB_INTERFACE_START *********
message_MDB = Hello dor 
***************** MDB_INTERFACE_END *********** 

Actual result:
--------------
****************** OCI_INTERFACE ****************
message_OCI = Hello dor
****************** OCI_INTERFACE_END ***********
****************** MDB_INTERFACE_START *********
message_MDB =
***************** MDB_INTERFACE_END ***********</pre>]]></description>
      <dc:date>2010-06-10T14:57:06+00:00</dc:date>
      <dc:creator>hannibal218 &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2_Driver_oci8 Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15922">
      <title>MDB2_Driver_oci8: Bug 15922 [Open] LOB support only works with named placeholders</title>
      <link>http://pear.php.net/bugs/15922</link>
      <content:encoded><![CDATA[<pre>MDB2_Driver_oci8 Bug
Reported by mameier
2009-02-20T18:26:12+00:00
PHP: 5.2.5 OS: linux Package Version: 

Description:
------------
      assuming a table 
create table lobtest (id number(10), lots_of_chars clob)
I get the error mentioned below.
The reason is, that the expression in the RETURNING clause does not reference the LOB.
To reference the CLOB column, the names parameter also has to have the same name as then db column.
Unfortunately autoPrepare and autoExecute are building queries with ? as placeholders, so they don't work.
Modifying autoPrepare to build queries with named parameters would be easy, but would break compatibility :-( 
The cause of the problem is in MDB2_Driver_oci8::prepare(). Here it would be necessary to identify the name of the LOB column and store it in $lobs[].
So I don't have an easy solution.

Test script:
---------------
      $data = array('id'=&gt;1,'lots_of_chars'=&gt;'any number of information');
$types = array('integer','clob');
// this way it works
$query = &quot;insert into lobtest (id,lots_of_chars) values (:id, :lots_of_chars)&quot;;
$stm =&amp; $db-&gt;prepare($query,$types,MDB2_PREPARE_MANIP);
$res = $stm-&gt;execute($data);
if (PEAR::isError($res)) { echo $res-&gt;getMessage().' '.$res-&gt;getUserInfo().&quot;\n&quot;; } else echo &quot;OK\n&quot;;

// this way it doesn't
$query = &quot;insert into lobtest (id,lots_of_chars) values (?,?)&quot;;
$stm =&amp; $db-&gt;prepare($query,$types,MDB2_PREPARE_MANIP);
$res = $stm-&gt;execute(array_values($data));
if (PEAR::isError($res)) { echo $res-&gt;getMessage().' '.$res-&gt;getUserInfo().&quot;\n&quot;; } else echo &quot;OK\n&quot;;


Expected result:
----------------
      OK
OK

Actual result:
--------------
      OK
MDB2 Error: unknown error _execute: [Error message: could not execute statement]
[Last executed query: insert into lobtest (id,lots_of_chars) values (:0,EMPTY_CLOB()) RETURNING 1 INTO :1]
[Native code: 932]
[Native message: ORA-00932: inconsistent datatypes: expected CLOB got NUMBER]</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Driver_oci8 Bug
Reported by mameier
2009-02-20T18:26:12+00:00
PHP: 5.2.5 OS: linux Package Version: 

Description:
------------
      assuming a table 
create table lobtest (id number(10), lots_of_chars clob)
I get the error mentioned below.
The reason is, that the expression in the RETURNING clause does not reference the LOB.
To reference the CLOB column, the names parameter also has to have the same name as then db column.
Unfortunately autoPrepare and autoExecute are building queries with ? as placeholders, so they don't work.
Modifying autoPrepare to build queries with named parameters would be easy, but would break compatibility :-( 
The cause of the problem is in MDB2_Driver_oci8::prepare(). Here it would be necessary to identify the name of the LOB column and store it in $lobs[].
So I don't have an easy solution.

Test script:
---------------
      $data = array('id'=&gt;1,'lots_of_chars'=&gt;'any number of information');
$types = array('integer','clob');
// this way it works
$query = &quot;insert into lobtest (id,lots_of_chars) values (:id, :lots_of_chars)&quot;;
$stm =&amp; $db-&gt;prepare($query,$types,MDB2_PREPARE_MANIP);
$res = $stm-&gt;execute($data);
if (PEAR::isError($res)) { echo $res-&gt;getMessage().' '.$res-&gt;getUserInfo().&quot;\n&quot;; } else echo &quot;OK\n&quot;;

// this way it doesn't
$query = &quot;insert into lobtest (id,lots_of_chars) values (?,?)&quot;;
$stm =&amp; $db-&gt;prepare($query,$types,MDB2_PREPARE_MANIP);
$res = $stm-&gt;execute(array_values($data));
if (PEAR::isError($res)) { echo $res-&gt;getMessage().' '.$res-&gt;getUserInfo().&quot;\n&quot;; } else echo &quot;OK\n&quot;;


Expected result:
----------------
      OK
OK

Actual result:
--------------
      OK
MDB2 Error: unknown error _execute: [Error message: could not execute statement]
[Last executed query: insert into lobtest (id,lots_of_chars) values (:0,EMPTY_CLOB()) RETURNING 1 INTO :1]
[Native code: 932]
[Native message: ORA-00932: inconsistent datatypes: expected CLOB got NUMBER]</pre>]]></description>
      <dc:date>2009-02-20T18:26:12+00:00</dc:date>
      <dc:creator>php &amp;#x61;&amp;#116; edv-beratung-meier &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>MDB2_Driver_oci8 Bug</dc:subject>
    </item>
</rdf:RDF>
