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

Bug #9601 rewriteCountQuery (Page_Wrapper.php) does not handle query with 'UNION' keyword
Submitted: 2006-12-12 12:04 UTC Modified: 2006-12-12 12:26 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  


 [2006-12-12 12: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 12: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.