<?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=Structures_DataGrid_DataSource_DataObject</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/15879" />

     </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/15879">
      <title>Structures_DataGrid_DataSource_DataObject: Bug 15879 [Open] error sort with databasename attached.</title>
      <link>http://pear.php.net/bugs/15879</link>
      <content:encoded><![CDATA[<pre>Structures_DataGrid_DataSource_DataObject Bug
Reported by rud5gtriplevision
2009-02-04T08:46:50+00:00
PHP: 5.2.5 OS: debian Package Version: 

Description:
------------
   when sorting through setDefaultSort, i need to add the database name, because i use a join with two tables with an ambiguous field: updated_ts (on which i want to sort).

result is (part of the SQL):

...ORDER BY `tablename.updated_ts` DESC;

this gives a SQL error: 
&quot;DB Error: no such field&quot;
[nativecode=1054 ** Unknown column 'tablename.updated_ts' in 'order clause']

this is because, in the file: /pear/Structures/DataGrid/DataSource/DataObject.php quoteIdentifier is used on the entire field, which in this case also contains the tablename.

i have an patch, which i will upload to this report. 
(the patch is only used in the case of passing the sort variables as an array, so check it.)

Test script:
---------------
   $do = DB_DataObject::factory ('tablename');
$jt = DB_DataObject::factory ('jointable');

$do-&gt;joinAdd ($jt);

$dg =&amp; new Structures_DataGrid ();
$dg-&gt;setDefaultSort (array ('tablename.updated_ts' =&gt; 'DESC'));

Expected result:
----------------
   the expected result is (part of the SQL):

...ORDER BY `databasename`.`updated_ts` DESC;

Actual result:
--------------
   the actual result is (part of the SQL):

...ORDER BY `databasename.updated_ts` DESC;</pre>]]></content:encoded>
      <description><![CDATA[<pre>Structures_DataGrid_DataSource_DataObject Bug
Reported by rud5gtriplevision
2009-02-04T08:46:50+00:00
PHP: 5.2.5 OS: debian Package Version: 

Description:
------------
   when sorting through setDefaultSort, i need to add the database name, because i use a join with two tables with an ambiguous field: updated_ts (on which i want to sort).

result is (part of the SQL):

...ORDER BY `tablename.updated_ts` DESC;

this gives a SQL error: 
&quot;DB Error: no such field&quot;
[nativecode=1054 ** Unknown column 'tablename.updated_ts' in 'order clause']

this is because, in the file: /pear/Structures/DataGrid/DataSource/DataObject.php quoteIdentifier is used on the entire field, which in this case also contains the tablename.

i have an patch, which i will upload to this report. 
(the patch is only used in the case of passing the sort variables as an array, so check it.)

Test script:
---------------
   $do = DB_DataObject::factory ('tablename');
$jt = DB_DataObject::factory ('jointable');

$do-&gt;joinAdd ($jt);

$dg =&amp; new Structures_DataGrid ();
$dg-&gt;setDefaultSort (array ('tablename.updated_ts' =&gt; 'DESC'));

Expected result:
----------------
   the expected result is (part of the SQL):

...ORDER BY `databasename`.`updated_ts` DESC;

Actual result:
--------------
   the actual result is (part of the SQL):

...ORDER BY `databasename.updated_ts` DESC;</pre>]]></description>
      <dc:date>2009-02-04T09:01:56+00:00</dc:date>
      <dc:creator>admin &amp;#x61;&amp;#116; triplevision &amp;#x64;&amp;#111;&amp;#x74; nl</dc:creator>
      <dc:subject>Structures_DataGrid_DataSource_DataObject Bug</dc:subject>
    </item>
</rdf:RDF>
