Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.7.1
-
Fix Version/s: 1.8.4
-
Component/s: Zend_Paginator
-
Labels:None
Description
The DbSelect adapter fails under Oracle, because Oracle does not support statements like:
SELECT COUNT(DISTINCT column1, column2, column3) FROM table_name
Instead, in Oracle, the statement should be:
SELECT COUNT(DISTINCT column1||column2||column3) FROM table_name
I made a quick fix by changing Zend/Paginator/Adapter/DbSelect.php, but then this would only support Oracle(which is no problem in my case)
The fix is not perfect, there is a chance of failure, but I suppose the '###' string could be changed to something unique.
187,188d186 < //ORACLE COUNT(DISTINCT col1||col2..) fix < $groupPart = str_replace(",", "||'###'||", $groupPart);
Sample code:
$select = new Zend_Db_Select($this->db); $select->from("product_transfers", array( "quantity" => "SUM(quantity)", "product_id", "name", "batch_number")); $select->group(array( "product_id", "name", "batch_number")); $paginator = Zend_Paginator::factory($select);
Please, could you provide a complete reproduce code?