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

Bug #9342 function count() gives wrong answer with UNION query
Submitted: 2006-11-15 17:49 UTC
From: HarrySchool at netscape dot net Assigned: olivierg
Status: Closed Package: Structures_DataGrid_DataSource_MDB2 (version 0.1.2)
PHP Version: 4.4.3 OS: windows & linux
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 27 + 9 = ?

 
 [2006-11-15 17:49 UTC] HarrySchool at netscape dot net (HarrySchool)
Description: ------------ In function count(), line 258 GROUP BY and DISTINCT are treated as special cases. Als UNION should be treated as such. See patch below Test script: --------------- Path: function count(), line 258 original: elseif (preg_match('#GROUP\s*BY#is', $this->_query) === 1 || reg_match('#SELECT.*DISTINCT.*FROM#is', $this->_query) === 1 should be replaced by: elseif (preg_match('#GROUP\s*BY#is', $this->_query) === 1 || preg_match('#\s*UNION\s*#is', $this->_query) === 1 || reg_match('#SELECT.*DISTINCT.*FROM#is', $this->_query) === 1

Comments

 [2006-11-16 12:29 UTC] olivierg at php dot net (Olivier Guilyardi)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.