ZF-4613: Passing a Zend_Db_Select Object to Zend_Paginator when using Oracle results in an Error

Description

When using Zend_Paginator in Conjunction with a Zend_Db_Select Object on Oracle, an E_NOTICE is raised in Zend_Paginator_Adapter_DbSelect.

Output:

 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); 

to:

 
$expression = new Zend_Db_Expr($countPart . ' AS "' . self::ROW_COUNT_COLUMN . '"');  

Comments

The fix for this will be option 3, but it should use quoteIdentifier() instead in the interest of portability.

Need to retrieve Adapter from Zend_Db_Select object

Fixed in SVN12209

This cannot be considered completely resolved until there is a corresponding unit test.

All Zend_Paginator_DbSelect and Zend_Paginator_DbTableSelect are written for Oracle (SVN12285)

Changing issues in preparation for the 1.7.0 release.