Zend Framework

Zend_Paginator_Adapter_DbSelect fails on HAVING clause

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.8.4
  • Component/s: Zend_Paginator
  • Labels:
    None

Description

Zend_Paginator_Adapter_DbSelect seems to create a wrong query for getting the count when the query has a 'HAVING' in it.

Simplified example:

$select = $db->select()
->from('user', 'user_id AS foo')
->having('foo > ?', 4);

// query is: SELECT `user`.`user_id` AS `foo` FROM `user` HAVING (foo > 4)

$paginator = new Zend_Paginator(new Zend_Paginator_Adapter_DbSelect($select));

Created query is:
SELECT COUNT AS `zend_paginator_row_count` FROM `user` HAVING (foo > 4)

which is obviously not working.

Haven't tested it yet in 1.8.0.

BR
anselm

Activity

Hide
Jurrien Stutterheim added a comment -

Resolved in r16157 and merged to release-1.8 in r16158

Show
Jurrien Stutterheim added a comment - Resolved in r16157 and merged to release-1.8 in r16158

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: