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

Bug #9601 rewriteCountQuery (Page_Wrapper.php) does not handle query with 'UNION' keyword
Submitted: 2006-12-12 17:04 UTC
From: s dot beni at planinformatica dot it Assigned: quipo
Status: Closed Package: Pager (version 2.4.3)
PHP Version: 4.4.4 OS: Win32
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 : 45 - 3 = ?

 
 [2006-12-12 17:04 UTC] s dot beni at planinformatica dot it (Sandro Beni)
Description: ------------ The function rewriteCountQuery into Page_Wrapper.php does not handle queries containing "UNION" keyword. I think that the following modifications at the beginning of the function can solve this problem: if (preg_match('/^\s*SELECT\s+\bDISTINCT\b/is', $sql) || preg_match('/\s+GROUP\s+BY\s+/is', $sql) || preg_match('/\s+UNION\s+/is', $sql)) { // patch return false; }

Comments

 [2006-12-12 17:26 UTC] quipo (Lorenzo Alberton)
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.