<?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/16117" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15481" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15142" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15115" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14603" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14271" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13676" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13537" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13366" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13193" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12673" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12546" />
      <rdf:li rdf:resource="http://pear.php.net/bug/11993" />

     </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/16117">
      <title>DB: Bug 16117 [Open] MSSQL escape doesn't take into account trailing backslashes</title>
      <link>http://pear.php.net/bugs/16117</link>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by urkle
2009-04-17T19:58:13+00:00
PHP: 5.2.9 OS: CentOS 5 Package Version: 1.7.13

Description:
------------
when inserting a string that has a trailing backslash followed by a new line (either CR or LF or BOTH) the backslash and the new line is stripped by SQL Server.   

Instead an EXTRA check needs to be made to escape the trailing backslash with another backslash.  (ie.. C:\\ instead of C:\) but ONLY if it appears at the end of a line.  escaping backslashes anywhere else in the input will cause the backslash to be added twice.

Documentation: http://support.microsoft.com/kb/164291
(NOTE that the document is slightly incorrect in that you do NOT replace \&lt;cr&gt;&lt;lf&gt; with \\&lt;cr&gt;&lt;lf&gt;&lt;cr&gt;&lt;lf&gt;  Only once set of new line sequences is needed.. Just simply added an extra \ before the trailing \ is all that is needed.)

Test script:
---------------
$db = DB::connect(&quot;mssql://server:1433/database&quot;);
$db-&gt;query(&quot;CREATE TABLE #temp (f1 TEXT)&quot;);
$db-&gt;query(&quot;INSERT INTO #temp VALUES (&quot;
     .$db-&gt;quoteSmart(&quot;Test C:\\\nHello&quot;)
    .&quot;)&quot;);
echo $db-&gt;getOne(&quot;SELECT f1 FROM #temp&quot;);
$db-&gt;query(&quot;DROP TABLE #temp&quot;);

Expected result:
----------------
echoing 

C:\
Hello

Actual result:
--------------
echoing

C:Hello</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Bug
Reported by urkle
2009-04-17T19:58:13+00:00
PHP: 5.2.9 OS: CentOS 5 Package Version: 1.7.13

Description:
------------
when inserting a string that has a trailing backslash followed by a new line (either CR or LF or BOTH) the backslash and the new line is stripped by SQL Server.   

Instead an EXTRA check needs to be made to escape the trailing backslash with another backslash.  (ie.. C:\\ instead of C:\) but ONLY if it appears at the end of a line.  escaping backslashes anywhere else in the input will cause the backslash to be added twice.

Documentation: http://support.microsoft.com/kb/164291
(NOTE that the document is slightly incorrect in that you do NOT replace \&lt;cr&gt;&lt;lf&gt; with \\&lt;cr&gt;&lt;lf&gt;&lt;cr&gt;&lt;lf&gt;  Only once set of new line sequences is needed.. Just simply added an extra \ before the trailing \ is all that is needed.)

Test script:
---------------
$db = DB::connect(&quot;mssql://server:1433/database&quot;);
$db-&gt;query(&quot;CREATE TABLE #temp (f1 TEXT)&quot;);
$db-&gt;query(&quot;INSERT INTO #temp VALUES (&quot;
     .$db-&gt;quoteSmart(&quot;Test C:\\\nHello&quot;)
    .&quot;)&quot;);
echo $db-&gt;getOne(&quot;SELECT f1 FROM #temp&quot;);
$db-&gt;query(&quot;DROP TABLE #temp&quot;);

Expected result:
----------------
echoing 

C:\
Hello

Actual result:
--------------
echoing

C:Hello</pre>]]></description>
      <dc:date>2009-04-17T19:58:13+00:00</dc:date>
      <dc:creator>eddie &amp;#x61;&amp;#116; omegaware &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15481">
      <title>DB: Bug 15481 [Analyzed] float values are quoted</title>
      <link>http://pear.php.net/bugs/15481</link>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by ukiewel
2009-01-01T21:25:24+00:00
PHP: 5.2.8 OS: Linux Package Version: 1.7.13

Description:
------------
Integer values are passed correctly to the database backend (DB2 via ODBC) float values are being quoted. That quote is imho a bug. Float values have also passed unquoted to the database backend.



Test script:
---------------
 $dbh-&gt;query($update, array(2, 3.5, 4.5, 24));

Expected result:
----------------
correct statemend passed to the db with unquoted numeric values

Actual result:
--------------
integers are unquoted, floats are quoted:

from the DB2 trace:
UPDATE policy SET spam_tag_level = 2, spam_tag2_level = '3.5', spam_kill_level = '4.5' WHERE id = 48</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Bug
Reported by ukiewel
2009-01-01T21:25:24+00:00
PHP: 5.2.8 OS: Linux Package Version: 1.7.13

Description:
------------
Integer values are passed correctly to the database backend (DB2 via ODBC) float values are being quoted. That quote is imho a bug. Float values have also passed unquoted to the database backend.



Test script:
---------------
 $dbh-&gt;query($update, array(2, 3.5, 4.5, 24));

Expected result:
----------------
correct statemend passed to the db with unquoted numeric values

Actual result:
--------------
integers are unquoted, floats are quoted:

from the DB2 trace:
UPDATE policy SET spam_tag_level = 2, spam_tag2_level = '3.5', spam_kill_level = '4.5' WHERE id = 48</pre>]]></description>
      <dc:date>2009-01-15T09:50:55+00:00</dc:date>
      <dc:creator>ml &amp;#x61;&amp;#116; kiewel-online &amp;#x64;&amp;#111;&amp;#x74; ch</dc:creator>
      <dc:subject>DB Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15142">
      <title>DB: Bug 15142 [Open] Commands out of sync , without reason!</title>
      <link>http://pear.php.net/bugs/15142</link>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by kmak
2008-11-24T08:39:36+00:00
PHP: 5.2.6 OS: gentoo Package Version: 1.7.13

Description:
------------
While i do free the DB_Result object that return from a query, i still get an out of sync message when i try to make a new query. That only happens after a procedure call query.

i have mysql 5.0.60-r1

Thank you.

Test script:
---------------
    require('my_db_conf.php');
    require('DB.php');


    $db_link = DB::connect(MAIN_DB_URL);

    if (PEAR::isError($db_link))
    {
            echo &quot;Error connecting: &quot;.$db_link-&gt;getMessage().&quot;\n&quot;;
            exit(1);
    }

    $db_link-&gt;setFetchMode(DB_FETCHMODE_ASSOC);

    // Set names to utf8
    $res =&amp; $db_link-&gt;query(&quot;set names utf8&quot;);

    if($res === DB_OK) echo &quot;res is DB_OK no free is required...\n&quot;;

    if(PEAR::isError($res) || $res !== DB_OK)
    {
        echo &quot;Error seting utf names...\n&quot;;
        exit(1);
    }

    //here i call the stored procedure...
    $query = &quot;call myStoredProc()&quot;; //it does a select only inside

    $res =&amp; $db_link-&gt;query($query);
    if(PEAR::isError($res))
    {
        echo &quot;Error executing query:&quot;.$query.&quot;\n&quot;;
        exit(1);
    }

    //here i free the results of the stored procedure
    $res-&gt;free();


    //here i call something else...
    $query = &quot;SELECT * FROM table1&quot;;
    $res =&amp; $db_link-&gt;query($query);
    if(PEAR::isError($res))
    {
        echo &quot;Error executing query:&quot;.$query.&quot;\n&quot;;
        echo &quot;Debug info!:&quot;.$res-&gt;getDebugInfo().&quot;\n&quot;;
        exit(1);
    }

    $res-&gt;free();
    $db_link-&gt;disconnect();

Expected result:
----------------
res is DB_OK no free is required...

Actual result:
--------------
res is DB_OK no free is required...
Error executing query:SELECT * FROM table1
Debug info!:SELECT * FROM table1 [nativecode=2014 ** Commands out of sync; you can't run this command now]</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Bug
Reported by kmak
2008-11-24T08:39:36+00:00
PHP: 5.2.6 OS: gentoo Package Version: 1.7.13

Description:
------------
While i do free the DB_Result object that return from a query, i still get an out of sync message when i try to make a new query. That only happens after a procedure call query.

i have mysql 5.0.60-r1

Thank you.

Test script:
---------------
    require('my_db_conf.php');
    require('DB.php');


    $db_link = DB::connect(MAIN_DB_URL);

    if (PEAR::isError($db_link))
    {
            echo &quot;Error connecting: &quot;.$db_link-&gt;getMessage().&quot;\n&quot;;
            exit(1);
    }

    $db_link-&gt;setFetchMode(DB_FETCHMODE_ASSOC);

    // Set names to utf8
    $res =&amp; $db_link-&gt;query(&quot;set names utf8&quot;);

    if($res === DB_OK) echo &quot;res is DB_OK no free is required...\n&quot;;

    if(PEAR::isError($res) || $res !== DB_OK)
    {
        echo &quot;Error seting utf names...\n&quot;;
        exit(1);
    }

    //here i call the stored procedure...
    $query = &quot;call myStoredProc()&quot;; //it does a select only inside

    $res =&amp; $db_link-&gt;query($query);
    if(PEAR::isError($res))
    {
        echo &quot;Error executing query:&quot;.$query.&quot;\n&quot;;
        exit(1);
    }

    //here i free the results of the stored procedure
    $res-&gt;free();


    //here i call something else...
    $query = &quot;SELECT * FROM table1&quot;;
    $res =&amp; $db_link-&gt;query($query);
    if(PEAR::isError($res))
    {
        echo &quot;Error executing query:&quot;.$query.&quot;\n&quot;;
        echo &quot;Debug info!:&quot;.$res-&gt;getDebugInfo().&quot;\n&quot;;
        exit(1);
    }

    $res-&gt;free();
    $db_link-&gt;disconnect();

Expected result:
----------------
res is DB_OK no free is required...

Actual result:
--------------
res is DB_OK no free is required...
Error executing query:SELECT * FROM table1
Debug info!:SELECT * FROM table1 [nativecode=2014 ** Commands out of sync; you can't run this command now]</pre>]]></description>
      <dc:date>2009-02-07T15:32:19+00:00</dc:date>
      <dc:creator>kmak &amp;#x61;&amp;#116; ccf &amp;#x64;&amp;#111;&amp;#x74; auth &amp;#x64;&amp;#111;&amp;#x74; gr</dc:creator>
      <dc:subject>DB Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15115">
      <title>DB: Bug 15115 [Verified] __wakeup passes the wrong params to connect</title>
      <link>http://pear.php.net/bugs/15115</link>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by jonty
2008-11-21T12:10:50+00:00
PHP: 5.2.5 OS: Linux Package Version: 1.7.14RC1

Description:
------------
The __wakeup method in DB/common.php passes the -&gt;options array to -&gt;connect(). -&gt;connect() takes a boolean ($persistent), not an array of options.

This means that any deserialised DB connection will always reconnect in persistent mode.

Attached is a patch to fix this, written in a manner that should deal with both old and new style calls to -&gt;connect().</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Bug
Reported by jonty
2008-11-21T12:10:50+00:00
PHP: 5.2.5 OS: Linux Package Version: 1.7.14RC1

Description:
------------
The __wakeup method in DB/common.php passes the -&gt;options array to -&gt;connect(). -&gt;connect() takes a boolean ($persistent), not an array of options.

This means that any deserialised DB connection will always reconnect in persistent mode.

Attached is a patch to fix this, written in a manner that should deal with both old and new style calls to -&gt;connect().</pre>]]></description>
      <dc:date>2009-02-07T15:18:29+00:00</dc:date>
      <dc:creator>jonty &amp;#x61;&amp;#116; jonty &amp;#x64;&amp;#111;&amp;#x74; co &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>DB Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14603">
      <title>DB: Bug 14603 [Open] Wrong replace in last_query</title>
      <link>http://pear.php.net/bugs/14603</link>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by mds123
2008-09-05T13:59:06+00:00
PHP: 5.1.6 OS: linux Package Version: 1.7.13

Description:
------------
It replaces bindN in all string, replacing also bindNN when it should not.

Test script:
---------------
Correction to apply to oci8 driver:

@@ -668,11 +668,12 @@ class DB_oci8 extends DB_common
             }
             if (!@OCIBindByName($stmt, ':bind' . $i, $data[$key], -1)) {
                 $tmp = $this-&gt;oci8RaiseError($stmt);
                 return $tmp;
             }
-            $this-&gt;last_query = str_replace(':bind'.$i, $this-&gt;quoteSmart($data[$key]), $this-&gt;last_query);
+            //$this-&gt;last_query = str_replace(':bind'.$i, $this-&gt;quoteSmart($data[$key]), $this-&gt;last_query);
+            $this-&gt;last_query = substr_replace($this-&gt;last_query, $this-&gt;quoteSmart($data[$key]), strpos($this-&gt;last_query, ':bind'.$i), strlen(':bind'.$i));
             $i++;
         }
         if ($this-&gt;autocommit) {
             $success = @OCIExecute($stmt, OCI_COMMIT_ON_SUCCESS);
         } else {</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Bug
Reported by mds123
2008-09-05T13:59:06+00:00
PHP: 5.1.6 OS: linux Package Version: 1.7.13

Description:
------------
It replaces bindN in all string, replacing also bindNN when it should not.

Test script:
---------------
Correction to apply to oci8 driver:

@@ -668,11 +668,12 @@ class DB_oci8 extends DB_common
             }
             if (!@OCIBindByName($stmt, ':bind' . $i, $data[$key], -1)) {
                 $tmp = $this-&gt;oci8RaiseError($stmt);
                 return $tmp;
             }
-            $this-&gt;last_query = str_replace(':bind'.$i, $this-&gt;quoteSmart($data[$key]), $this-&gt;last_query);
+            //$this-&gt;last_query = str_replace(':bind'.$i, $this-&gt;quoteSmart($data[$key]), $this-&gt;last_query);
+            $this-&gt;last_query = substr_replace($this-&gt;last_query, $this-&gt;quoteSmart($data[$key]), strpos($this-&gt;last_query, ':bind'.$i), strlen(':bind'.$i));
             $i++;
         }
         if ($this-&gt;autocommit) {
             $success = @OCIExecute($stmt, OCI_COMMIT_ON_SUCCESS);
         } else {</pre>]]></description>
      <dc:date>2008-09-19T09:56:31+00:00</dc:date>
      <dc:creator>marciodick &amp;#x61;&amp;#116; yahoo &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14271">
      <title>DB: Bug 14271 [Open] oci8: freePrepared() does not free _prepared_queries array</title>
      <link>http://pear.php.net/bugs/14271</link>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by falk
2008-07-01T08:34:54+00:00
PHP: 5.2.6 OS: Linux Package Version: 1.7.14RC1

Description:
------------
The Method freePrepared() in oci8.php does not free the prepared SQL queries. Add &quot;unset($this-&gt;_prepared_queries[(int)$stmt]);&quot;</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Bug
Reported by falk
2008-07-01T08:34:54+00:00
PHP: 5.2.6 OS: Linux Package Version: 1.7.14RC1

Description:
------------
The Method freePrepared() in oci8.php does not free the prepared SQL queries. Add &quot;unset($this-&gt;_prepared_queries[(int)$stmt]);&quot;</pre>]]></description>
      <dc:date>2008-07-01T08:34:54+00:00</dc:date>
      <dc:creator>falk &amp;#x64;&amp;#111;&amp;#x74; herrmann &amp;#x61;&amp;#116; bike24 &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>DB Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13676">
      <title>DB: Bug 13676 [Open] db2connection from PHP</title>
      <link>http://pear.php.net/bugs/13676</link>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by sobhanmaddineni
2008-04-14T09:17:44+00:00
PHP: 4.4.0 OS: Linux Package Version: 

Description:
------------
My application is connecting to DB2 7.1 version earleir using db2connect, now the database has upgraded to 8.0, now we are getting problems in accessing the application.
PHP Version:4.4, PEAR version:1.50.2.18

I here by attached a sample file which i am using, please provide me the solution for this problem if you already know it.

Thanks!

Test script:
---------------
&lt;?php
   define(&quot;DB_CONFIG&quot;,'development');
// load the global configuration
require_once('../config/variables.inc.php');
// connect to database
require('../include/dbConnect.inc.php');
debug(&quot;got connection to database&quot;);
$sql_tests = array(
&quot;SELECT count(*) FROM $database.ccrest&quot;);
$db-&gt;setFetchMode(DB_FETCHMODE_ASSOC);
foreach ($sql_tests as $sql) {
   debug (&quot;executing: $sql&quot;);
   $res =&amp; $db-&gt;query($sql);
   if (DB::isError($res)) {
      debug_db($res);
      continue;
   }
   if (DB_OK != $res) {
      while ($row =&amp; $res-&gt;fetchRow()) {
         $row = lowerCase($row);
         debug($row);
      }
   }
   debug (&quot;done&quot;);
}
$db-&gt;disconnect();
?&gt;


Expected result:
----------------
29

Actual result:
--------------
Standard Message: DB Error: unknown error
Standard Code: -1
DBMS/User Message: SELECT count(*) FROM db.ccrest [nativecode=36001 [IBM][CLI Driver][DB2] SQL0243N SENSITIVE cursor &quot;SQL_CURSH200C4&quot; cannot be defined for the specified SELECT statement.  SQLSTATE=36001]
DBMS/Debug Message: SELECT count(*) FROM db.ccrest [nativecode=36001 [IBM][CLI Driver][DB2] SQL0243N SENSITIVE cursor &quot;SQL_CURSH200C4&quot; cannot be defined for the specified SELECT statement.  SQLSTATE=36001]</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Bug
Reported by sobhanmaddineni
2008-04-14T09:17:44+00:00
PHP: 4.4.0 OS: Linux Package Version: 

Description:
------------
My application is connecting to DB2 7.1 version earleir using db2connect, now the database has upgraded to 8.0, now we are getting problems in accessing the application.
PHP Version:4.4, PEAR version:1.50.2.18

I here by attached a sample file which i am using, please provide me the solution for this problem if you already know it.

Thanks!

Test script:
---------------
&lt;?php
   define(&quot;DB_CONFIG&quot;,'development');
// load the global configuration
require_once('../config/variables.inc.php');
// connect to database
require('../include/dbConnect.inc.php');
debug(&quot;got connection to database&quot;);
$sql_tests = array(
&quot;SELECT count(*) FROM $database.ccrest&quot;);
$db-&gt;setFetchMode(DB_FETCHMODE_ASSOC);
foreach ($sql_tests as $sql) {
   debug (&quot;executing: $sql&quot;);
   $res =&amp; $db-&gt;query($sql);
   if (DB::isError($res)) {
      debug_db($res);
      continue;
   }
   if (DB_OK != $res) {
      while ($row =&amp; $res-&gt;fetchRow()) {
         $row = lowerCase($row);
         debug($row);
      }
   }
   debug (&quot;done&quot;);
}
$db-&gt;disconnect();
?&gt;


Expected result:
----------------
29

Actual result:
--------------
Standard Message: DB Error: unknown error
Standard Code: -1
DBMS/User Message: SELECT count(*) FROM db.ccrest [nativecode=36001 [IBM][CLI Driver][DB2] SQL0243N SENSITIVE cursor &quot;SQL_CURSH200C4&quot; cannot be defined for the specified SELECT statement.  SQLSTATE=36001]
DBMS/Debug Message: SELECT count(*) FROM db.ccrest [nativecode=36001 [IBM][CLI Driver][DB2] SQL0243N SENSITIVE cursor &quot;SQL_CURSH200C4&quot; cannot be defined for the specified SELECT statement.  SQLSTATE=36001]</pre>]]></description>
      <dc:date>2008-04-14T09:52:30+00:00</dc:date>
      <dc:creator>sobhan &amp;#x64;&amp;#111;&amp;#x74; maddineni &amp;#x61;&amp;#116; logica &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13537">
      <title>DB: Bug 13537 [Open] limitQuery always returns the same result set</title>
      <link>http://pear.php.net/bugs/13537</link>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by rui
2008-03-30T05:29:56+00:00
PHP: 5.2.3 OS: linux Package Version: 1.7.13

Description:
------------
limitQuery always returns the same result set, the output of  var_dump($db-&gt;last_query); is:

string(38) &quot;select id, nome, data_nasc from testes&quot;

var_dump($data-&gt;limit_from); and var_dump($data-&gt;limit_count);
both return NULL

I'm using unixodbc + freetds driver to access a MSSQL database.

Test script:
---------------
function whatever($db, $from, $count) {

$sth =&amp; $db-&gt;limitQuery(&quot;select id, nome, data_nasc from testes&quot;, $from, $count);

while ($row =&amp; $data-&gt;fetchRow()) {
        echo &quot;&lt;tr&gt;&quot;;
        echo &quot;&lt;td&gt;&lt;center&gt;&quot; . $row[0] . &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; . $row[1] . &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; . $row[2] . &quot;&lt;/center&gt;&lt;/td&gt;&quot;;
        echo &quot;&lt;/tr&gt;&quot;;
}
}

whatever($db, 0, 20);
whatever($db, 40, 20);
whatever($db, 60, 20);


Expected result:
----------------
1, whatever, whatever
2, whatever, whatever
(...)
20, whatever, whatever
21, whatever, whatever
22, whatever, whatever
(...)
40, whatever, whatever
41, whatever, whatever
42, whatever, whatever
(...)
60, whatever, whatever

Actual result:
--------------
1, whatever, whatever
2, whatever, whatever
(...)
20, whatever, whatever
1, whatever, whatever
2, whatever, whatever
(...)
20, whatever, whatever
1, whatever, whatever
2, whatever, whatever
(...)
20, whatever, whatever</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Bug
Reported by rui
2008-03-30T05:29:56+00:00
PHP: 5.2.3 OS: linux Package Version: 1.7.13

Description:
------------
limitQuery always returns the same result set, the output of  var_dump($db-&gt;last_query); is:

string(38) &quot;select id, nome, data_nasc from testes&quot;

var_dump($data-&gt;limit_from); and var_dump($data-&gt;limit_count);
both return NULL

I'm using unixodbc + freetds driver to access a MSSQL database.

Test script:
---------------
function whatever($db, $from, $count) {

$sth =&amp; $db-&gt;limitQuery(&quot;select id, nome, data_nasc from testes&quot;, $from, $count);

while ($row =&amp; $data-&gt;fetchRow()) {
        echo &quot;&lt;tr&gt;&quot;;
        echo &quot;&lt;td&gt;&lt;center&gt;&quot; . $row[0] . &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; . $row[1] . &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; . $row[2] . &quot;&lt;/center&gt;&lt;/td&gt;&quot;;
        echo &quot;&lt;/tr&gt;&quot;;
}
}

whatever($db, 0, 20);
whatever($db, 40, 20);
whatever($db, 60, 20);


Expected result:
----------------
1, whatever, whatever
2, whatever, whatever
(...)
20, whatever, whatever
21, whatever, whatever
22, whatever, whatever
(...)
40, whatever, whatever
41, whatever, whatever
42, whatever, whatever
(...)
60, whatever, whatever

Actual result:
--------------
1, whatever, whatever
2, whatever, whatever
(...)
20, whatever, whatever
1, whatever, whatever
2, whatever, whatever
(...)
20, whatever, whatever
1, whatever, whatever
2, whatever, whatever
(...)
20, whatever, whatever</pre>]]></description>
      <dc:date>2008-03-30T05:29:56+00:00</dc:date>
      <dc:creator>ruifilipe &amp;#x64;&amp;#111;&amp;#x74; reis &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13366">
      <title>DB: Bug 13366 [Open] nextId does not correctly handle $ondemand parameter with PostgreSQL 8.2</title>
      <link>http://pear.php.net/bugs/13366</link>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by davidn
2008-03-10T16:39:33+00:00
PHP: 5.2.3 OS: Linux Package Version: 1.7.13

Description:
------------
Test script is very simple:
Just try to use the nextId function with PostgreSQL 8.2:

$db-&gt;nextId(&quot;toto&quot;, true);

The sequence &quot;toto_seq&quot; should not exist.
Pear should try to create the sequence.

Actually, the test made in nextId in pgsql.php line 682 is:

if ($ondemand &amp;&amp; DB::isError($result) &amp;&amp;
                $result-&gt;getCode() == DB_ERROR_NOSUCHTABLE) {

But for some reason, $result-&gt;getCode() == DB_ERROR instead of $result-&gt;getCode() == DB_ERROR_NOSUCHTABLE, so the test is never accepted and the sequence never created.

Suggested step to correct: replace line 682 with:

if ($ondemand &amp;&amp; DB::isError($result) &amp;&amp;
                ($result-&gt;getCode() == DB_ERROR_NOSUCHTABLE || $result-&gt;getCode() == DB_ERROR)) {


Best regards,
David.</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Bug
Reported by davidn
2008-03-10T16:39:33+00:00
PHP: 5.2.3 OS: Linux Package Version: 1.7.13

Description:
------------
Test script is very simple:
Just try to use the nextId function with PostgreSQL 8.2:

$db-&gt;nextId(&quot;toto&quot;, true);

The sequence &quot;toto_seq&quot; should not exist.
Pear should try to create the sequence.

Actually, the test made in nextId in pgsql.php line 682 is:

if ($ondemand &amp;&amp; DB::isError($result) &amp;&amp;
                $result-&gt;getCode() == DB_ERROR_NOSUCHTABLE) {

But for some reason, $result-&gt;getCode() == DB_ERROR instead of $result-&gt;getCode() == DB_ERROR_NOSUCHTABLE, so the test is never accepted and the sequence never created.

Suggested step to correct: replace line 682 with:

if ($ondemand &amp;&amp; DB::isError($result) &amp;&amp;
                ($result-&gt;getCode() == DB_ERROR_NOSUCHTABLE || $result-&gt;getCode() == DB_ERROR)) {


Best regards,
David.</pre>]]></description>
      <dc:date>2008-03-10T16:39:33+00:00</dc:date>
      <dc:creator>d &amp;#x64;&amp;#111;&amp;#x74; negrier &amp;#x61;&amp;#116; thecodingmachine &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13193">
      <title>DB: Feature/Change Request 13193 [Open] 'auto_increment' feature in tableInfo() for sqlite</title>
      <link>http://pear.php.net/bugs/13193</link>
      <content:encoded><![CDATA[<pre>DB Feature/Change Request
Reported by rpuchkovskiy
2008-02-25T04:01:51+00:00
PHP: Irrelevant OS:  Package Version: 1.7.13

Description:
------------
Sqlite supports auto-incremented columns (integer primary key is auto-incremented), but current implementation of tableInfo() does not return this information.
I suggest adding following lines

            // integer primary key is autoincremented...
            if (strtoupper($type) == &quot;INTEGER&quot; &amp;&amp; $id[$i]['pk']) {
                $flags .= 'auto_increment ';
            }

below these lines

            if ($id[$i]['dflt_value'] !== null) {
                $flags .= 'default_' . rawurlencode($id[$i]['dflt_value']);
            }

in tableInfo() method of DB/sqlite.php. This will return 'auto_increment' feature for auto-incremented columns.</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Feature/Change Request
Reported by rpuchkovskiy
2008-02-25T04:01:51+00:00
PHP: Irrelevant OS:  Package Version: 1.7.13

Description:
------------
Sqlite supports auto-incremented columns (integer primary key is auto-incremented), but current implementation of tableInfo() does not return this information.
I suggest adding following lines

            // integer primary key is autoincremented...
            if (strtoupper($type) == &quot;INTEGER&quot; &amp;&amp; $id[$i]['pk']) {
                $flags .= 'auto_increment ';
            }

below these lines

            if ($id[$i]['dflt_value'] !== null) {
                $flags .= 'default_' . rawurlencode($id[$i]['dflt_value']);
            }

in tableInfo() method of DB/sqlite.php. This will return 'auto_increment' feature for auto-incremented columns.</pre>]]></description>
      <dc:date>2008-02-25T04:01:51+00:00</dc:date>
      <dc:creator>roman &amp;#x64;&amp;#111;&amp;#x74; puchkovskiy &amp;#x61;&amp;#116; blandware &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12673">
      <title>DB: Bug 12673 [Open] Return error when execute statement INSERT INTO [TABLE1] SELECT FROM [TABLE2]</title>
      <link>http://pear.php.net/bugs/12673</link>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by amusarra
2007-12-12T09:37:58+00:00
PHP: 4.4.7 OS: SUSE Enterprise Linux Server 10 Package Version: 1.7.13

Description:
------------
Running query type INSERT INTO [Customers] SELECT * FROM [New Customers] on the Informix database (Driver IFX.php) back error SQLCODE = 0. The query syntax is correct and supported by Informix.

Test script:
---------------
// Connect to db
...

// Prepared query
$stm = $db-&gt;prepare(&quot;INSERT INTO import_sap_log_old SELECT * FROM import_sap_log WHERE id=?&quot;);
$data = array($MAX_ID);
$res = $db-&gt;execute($s, $data);

....</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Bug
Reported by amusarra
2007-12-12T09:37:58+00:00
PHP: 4.4.7 OS: SUSE Enterprise Linux Server 10 Package Version: 1.7.13

Description:
------------
Running query type INSERT INTO [Customers] SELECT * FROM [New Customers] on the Informix database (Driver IFX.php) back error SQLCODE = 0. The query syntax is correct and supported by Informix.

Test script:
---------------
// Connect to db
...

// Prepared query
$stm = $db-&gt;prepare(&quot;INSERT INTO import_sap_log_old SELECT * FROM import_sap_log WHERE id=?&quot;);
$data = array($MAX_ID);
$res = $db-&gt;execute($s, $data);

....</pre>]]></description>
      <dc:date>2007-12-12T09:37:58+00:00</dc:date>
      <dc:creator>antonio &amp;#x64;&amp;#111;&amp;#x74; musarra &amp;#x61;&amp;#116; romcad &amp;#x64;&amp;#111;&amp;#x74; it</dc:creator>
      <dc:subject>DB Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12546">
      <title>DB: Bug 12546 [Open] pgsql commit() doesn't commit in non-autocommit mode</title>
      <link>http://pear.php.net/bugs/12546</link>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by canobi
2007-11-29T04:09:02+00:00
PHP: 4.3.10 OS: Linux Package Version: 1.7.13

Description:
------------
When trying to commit a transaction by calling commit() 
method of a DB object that has autoCommit set to false, 
the changes aren't commited. The current workaround I'm 
using is by executing a query with a 'commit;' statement, 
and then calling commit() (to reinitialize any transaction 
specific fields in the DB object).

Test script:
---------------
Connect as usual, then:
$dbh -&gt; autoCommit ( false );
$result = $dbh -&gt; query ( do an insert );
$dbh -&gt; commit ( );
$dbh -&gt; disconnect ( );


Expected result:
----------------
Expecting to see the inserted row in the database. The 
version of Postgres used is 7.4.

Actual result:
--------------
The inserted row is not present in the database.</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Bug
Reported by canobi
2007-11-29T04:09:02+00:00
PHP: 4.3.10 OS: Linux Package Version: 1.7.13

Description:
------------
When trying to commit a transaction by calling commit() 
method of a DB object that has autoCommit set to false, 
the changes aren't commited. The current workaround I'm 
using is by executing a query with a 'commit;' statement, 
and then calling commit() (to reinitialize any transaction 
specific fields in the DB object).

Test script:
---------------
Connect as usual, then:
$dbh -&gt; autoCommit ( false );
$result = $dbh -&gt; query ( do an insert );
$dbh -&gt; commit ( );
$dbh -&gt; disconnect ( );


Expected result:
----------------
Expecting to see the inserted row in the database. The 
version of Postgres used is 7.4.

Actual result:
--------------
The inserted row is not present in the database.</pre>]]></description>
      <dc:date>2007-11-29T04:09:02+00:00</dc:date>
      <dc:creator>canobix &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/11993">
      <title>DB: Bug 11993 [Assigned] ifx: cannot execute select on TEXT_FIELD</title>
      <link>http://pear.php.net/bugs/11993</link>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by argentim
2007-09-06T06:46:03+00:00
PHP: 5.2.4 OS: win_xp Package Version: 1.7.12

Description:
------------
Unable to execute a select on a table with TEXT fields
It doesn't work on Informix 9.40.uc3/esql 3.00.tc1 db
while it works on MySQL 5.0

Its a bug or something else to look/configure?


Test script:
---------------
after db connection:

$select=&quot;select &lt;long_field&gt; from table where row_id=1&quot;;
$result=$db-&gt;query($select);
if (DB::isError($result)) die($result-&gt;getMessage());

will return on ifx: &quot;DB Error: unknown error&quot;</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB Bug
Reported by argentim
2007-09-06T06:46:03+00:00
PHP: 5.2.4 OS: win_xp Package Version: 1.7.12

Description:
------------
Unable to execute a select on a table with TEXT fields
It doesn't work on Informix 9.40.uc3/esql 3.00.tc1 db
while it works on MySQL 5.0

Its a bug or something else to look/configure?


Test script:
---------------
after db connection:

$select=&quot;select &lt;long_field&gt; from table where row_id=1&quot;;
$result=$db-&gt;query($select);
if (DB::isError($result)) die($result-&gt;getMessage());

will return on ifx: &quot;DB Error: unknown error&quot;</pre>]]></description>
      <dc:date>2007-11-28T03:19:13+00:00</dc:date>
      <dc:creator>argenti &amp;#x64;&amp;#111;&amp;#x74; m &amp;#x61;&amp;#116; tin &amp;#x64;&amp;#111;&amp;#x74; it</dc:creator>
      <dc:subject>DB Bug</dc:subject>
    </item>
</rdf:RDF>
