ZF-4613: Passing a Zend_Db_Select Object to Zend_Paginator when using Oracle results in an Error
When using Zend_Paginator in Conjunction with a Zend_Db_Select Object on Oracle, an E_NOTICE is raised in Zend_Paginator_Adapter_DbSelect.
Notice: Undefined index: zend_paginator_row_count in C:\Web\lib\Zend\Paginator\Adapter\DbSelect.php on line 107
This happens when the Adapter attempts to retrieve the ROW_COUNT_COLUMN from the result array. The column name is defined in lower case, however Oracles default behavior is to return all column names in upper case, unless you explicitly wrap the column alias name in double quotes.
Possible fixes for this might be: 1. In Zend_Paginator_Adapter_DbSelect change value declared for ROW_COUNT_COLUMN to an upper case string. 2. Check that the array key exists in lower case, and if not use the upper case equivalent on line 107 of Zend_Paginator_Adapter_DbSelect 3. Change line 165 to wrap the column name in quotes. This would then change from:
$expression = new Zend_Db_Expr($countPart . ' AS ' . self::ROW_COUNT_COLUMN);
$expression = new Zend_Db_Expr($countPart . ' AS "' . self::ROW_COUNT_COLUMN . '"');