<?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=DB</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/23784" />
      <rdf:li rdf:resource="http://pear.php.net/bug/21217" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19794" />

     </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/23784">
      <title>DB: Bug 23784 [Open] The getRow method with placeholder causes PHP warning and doesn't return data</title>
      <link>http://pear.php.net/bugs/23784</link>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by blueblood
2018-12-21T09:38:24+00:00
PHP: 5.6.39 OS: CentOS Linux release 7.3.1611 Package Version: 1.9.3

Description:
------------
Dear,

The getRow method with placeholder occurs PHP warning and does not return correct result.
As far as checked, the value of &quot;result&quot; and &quot;statement&quot; property in DB_result object is updated from &quot;(oci8 statement)&quot; to &quot;(Unknown)&quot; after $this-&gt;freePrepared in common.php on line 1350 to be executed.
Please check it.
Thank you and best regards,


Test script:
---------------
&lt;?php
$dsn = 'please set';
$conn = DB::connect($dsn);
if (DB::isError($conn)) {
    echo &quot;connection failed&quot; . PHP_EOL;
    exit;
}

$sql = 'SELECT id FROM xxx_tbl WHERE user_hash = ?';
$params = ['1234567890'];
$row = $conn-&gt;getRow($sql, $params);
var_dump($row);
$conn-&gt;disconnect();
exit;

Expected result:
----------------
the first row's data in an array

Actual result:
--------------
I got the following PHP warning

PHP Warning:  ocifetchinto(): 20 is not a valid oci8 statement resource in /home/blueblood/vendor/pear-pear.php.net/DB/DB/oci8.php on line 397</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Bug
Reported by blueblood
2018-12-21T09:38:24+00:00
PHP: 5.6.39 OS: CentOS Linux release 7.3.1611 Package Version: 1.9.3

Description:
------------
Dear,

The getRow method with placeholder occurs PHP warning and does not return correct result.
As far as checked, the value of &quot;result&quot; and &quot;statement&quot; property in DB_result object is updated from &quot;(oci8 statement)&quot; to &quot;(Unknown)&quot; after $this-&gt;freePrepared in common.php on line 1350 to be executed.
Please check it.
Thank you and best regards,


Test script:
---------------
&lt;?php
$dsn = 'please set';
$conn = DB::connect($dsn);
if (DB::isError($conn)) {
    echo &quot;connection failed&quot; . PHP_EOL;
    exit;
}

$sql = 'SELECT id FROM xxx_tbl WHERE user_hash = ?';
$params = ['1234567890'];
$row = $conn-&gt;getRow($sql, $params);
var_dump($row);
$conn-&gt;disconnect();
exit;

Expected result:
----------------
the first row's data in an array

Actual result:
--------------
I got the following PHP warning

PHP Warning:  ocifetchinto(): 20 is not a valid oci8 statement resource in /home/blueblood/vendor/pear-pear.php.net/DB/DB/oci8.php on line 397</pre>]]></description>
      <dc:date>2018-12-21T12:43:04+00:00</dc:date>
      <dc:creator>blueblood74 &amp;#x61;&amp;#116; hotmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/21217">
      <title>DB: Bug 21217 [Assigned] autoExecute failed UPDATE if placeholders presents in WHERE</title>
      <link>http://pear.php.net/bugs/21217</link>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by enyby
2017-06-02T12:13:26+00:00
PHP: 5.6.29 OS: ANY Package Version: 1.9.2

Description:
------------
If you call autoExecute() and in WHERE present any of '!?&amp;' query simple fails. Does not matter where these symbols appear - inside string literal or in query (for example  'a != b').
This happens because inside autoExecute() where used for catch placeholders. For example you send to autoExecute() array with $data of 3 items and $where with 'a != b'. On autoPrepare() inside autoExecute() will be collected FOUR placeholders. 3 from $data and '!' inside $where as 4 placeholder.
After that will be called execute() with $data array. But it have only 3 values. It cause error because parsed statement required 4 values for 4 placeholders.

Solution: make replace in $where before send it to autoPrepare() inside autoExecute():

if ($where) {
    $where = strtr($where, array('?' =&gt; '\?', '!' =&gt; '\!', '&amp;' =&gt; '\&amp;',));
}

Test script:
---------------
$data = array('a' =&gt; 'a', 'b' =&gt; 'b', 'c' =&gt; 'c');
$ret = $db-&gt;autoExecute('table', $data, DB_AUTOQUERY_UPDATE, 'a != b');
var_dump($ret);

Expected result:
----------------
DB_OK

Actual result:
--------------
DB_ERROR: DB_ERROR_MISMATCH raised from executeEmulateQuery()</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Bug
Reported by enyby
2017-06-02T12:13:26+00:00
PHP: 5.6.29 OS: ANY Package Version: 1.9.2

Description:
------------
If you call autoExecute() and in WHERE present any of '!?&amp;' query simple fails. Does not matter where these symbols appear - inside string literal or in query (for example  'a != b').
This happens because inside autoExecute() where used for catch placeholders. For example you send to autoExecute() array with $data of 3 items and $where with 'a != b'. On autoPrepare() inside autoExecute() will be collected FOUR placeholders. 3 from $data and '!' inside $where as 4 placeholder.
After that will be called execute() with $data array. But it have only 3 values. It cause error because parsed statement required 4 values for 4 placeholders.

Solution: make replace in $where before send it to autoPrepare() inside autoExecute():

if ($where) {
    $where = strtr($where, array('?' =&gt; '\?', '!' =&gt; '\!', '&amp;' =&gt; '\&amp;',));
}

Test script:
---------------
$data = array('a' =&gt; 'a', 'b' =&gt; 'b', 'c' =&gt; 'c');
$ret = $db-&gt;autoExecute('table', $data, DB_AUTOQUERY_UPDATE, 'a != b');
var_dump($ret);

Expected result:
----------------
DB_OK

Actual result:
--------------
DB_ERROR: DB_ERROR_MISMATCH raised from executeEmulateQuery()</pre>]]></description>
      <dc:date>2018-07-20T18:30:32+00:00</dc:date>
      <dc:creator>enyby &amp;#x61;&amp;#116; ya &amp;#x64;&amp;#111;&amp;#x74; ru</dc:creator>
      <dc:subject>DB Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19794">
      <title>DB: Bug 19794 [Open] Can not use the literal &quot;select&quot; in text field</title>
      <link>http://pear.php.net/bugs/19794</link>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by blam
2013-01-23T00:45:15+00:00
PHP: 5.3.2 OS: Ubuntu 10.04.3 LTS Package Version: Unknown

Description:
------------
Can not use the word &quot;select&quot; as input of text field when trying to build web application. It will return the following error:  &quot;DB Error: unknown error&quot;. I try to insert data using prepare and execute, and error out. My system information are as follow:
Ubuntu 10.04.3 LTS
PHP Version 5.3.2-1ubuntu4.18
Pear DB-1.7.13
Informix 11.5


Test script:
---------------
$sql='update office set office_name=?,office_type=?,office_phone=? where office_number=?';
$sth = $dbh-&gt;prepare($sql);
if(DB::isError($sth)) { die ($sth-&gt;getDebugInfo()); }

$data = array($_GET['office_name'],$_GET['office_type'],$_GET['office_phone'],$_GET['office_number']);
			 $rcode1 = $dbh-&gt;execute($sth,$data);

Expected result:
----------------
Expected to update office_name, office_type, and office_phone.

Actual result:
--------------
When the office_name is equal to &quot;Select dental&quot; it failed. It failed because it include the keyword &quot;select&quot;. I get the following error &quot; DB Error: unknown error&quot; from Informix. When I tried to update the table directly using isql, it will work.</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Bug
Reported by blam
2013-01-23T00:45:15+00:00
PHP: 5.3.2 OS: Ubuntu 10.04.3 LTS Package Version: Unknown

Description:
------------
Can not use the word &quot;select&quot; as input of text field when trying to build web application. It will return the following error:  &quot;DB Error: unknown error&quot;. I try to insert data using prepare and execute, and error out. My system information are as follow:
Ubuntu 10.04.3 LTS
PHP Version 5.3.2-1ubuntu4.18
Pear DB-1.7.13
Informix 11.5


Test script:
---------------
$sql='update office set office_name=?,office_type=?,office_phone=? where office_number=?';
$sth = $dbh-&gt;prepare($sql);
if(DB::isError($sth)) { die ($sth-&gt;getDebugInfo()); }

$data = array($_GET['office_name'],$_GET['office_type'],$_GET['office_phone'],$_GET['office_number']);
			 $rcode1 = $dbh-&gt;execute($sth,$data);

Expected result:
----------------
Expected to update office_name, office_type, and office_phone.

Actual result:
--------------
When the office_name is equal to &quot;Select dental&quot; it failed. It failed because it include the keyword &quot;select&quot;. I get the following error &quot; DB Error: unknown error&quot; from Informix. When I tried to update the table directly using isql, it will work.</pre>]]></description>
      <dc:date>2013-01-23T00:45:15+00:00</dc:date>
      <dc:creator>blam &amp;#x61;&amp;#116; dentistat &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB Bug</dc:subject>
    </item>
</rdf:RDF>
