Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.1.11

Bug #10789 false positive on preg_match in fetch()
Submitted: 2007-04-20 20:27 UTC
From: ivotedforkodos Assigned: wiesemann
Status: Closed Package: Structures_DataGrid_DataSource_MDB2 (version 0.1.8)
PHP Version: Irrelevant OS: Win XP
Roadmaps: (Not assigned)    
Subscription  


 [2007-04-20 20:27 UTC] ivotedforkodos (Ben Baumer)
Description: ------------ The preg_match statement on line 217 of MDB2.php gives a false positive, in my case. I have a SQL field definition that includes the "orderBy" variable, and that triggers the preg_match statement, which result in "ORDER BY" not being added to the SQL statement, which then fails. Test script: --------------- $query="SELECT concat('<a href=\"?orderBy=Name\">',playerid,'</a>') as Name, HR from batting where teamid='NYN' and yearid=2006"; require_once 'Structures/DataGrid.php'; $datagrid=&new Structures_DataGrid(50); $datagrid->setRendererOption('convertEntities',0); $datagrid->bind($query,array('dsn'=>$dsn),'MDB2'); print_r($datagrid->getDataSource()->_db->last_query); $datagrid->render(); Expected result: ---------------- SELECT concat('<a href="?orderBy=Name">',playerid,'</a>') as Name, HR from batting where teamid='NYN' and yearid=2006, hr ASC LIMIT 0, 50 MDB2 Error: syntax error Actual result: -------------- SELECT concat('<a href="?orderBy=Name">',playerid,'</a>') as Name, HR from batting where teamid='NYN' and yearid=2006 ORDER BY hr ASC LIMIT 0, 50

Comments

 [2007-04-21 13:40 UTC] wiesemann (Mark Wiesemann)
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/Structures_DataGrid_DataSource_MDB2 --- Several regular expressions had similar problems, and I hopefully fixed all of them. At least your problem should be fixed anyway. I've also fixed the DBQuery driver.