ZF-7259: problem method getCountSelect()

Description

i am find an problem using Zend_Paginator_Adapter_DbSelect, my object is used the WHERE and launched an exception

added to the method getCountSelect

$rowCount->reset(Zend_Db_Select::WHERE)

Comments

Could you give more information? What's the exception? What's your query? Could you try and reproduce this with the latest version from SVN?

exception launched Zend_Db_Statement_Exception,
i am with the latest version,

problem query generated by getCountSelect

query passed object select

SELECT d.id,number_document ,type_document ,date_publication ,link FROM "key_word" AS "kw" INNER JOIN "word_document" AS "wd" ON kw.id = wd.key_word_id INNER JOIN "document" AS "d" ON d.id = wd.document_id INNER JOIN "type_document" AS "td" ON td.id = d.type_document_id WHERE (wd.id IN( 48, 21, 56, 47 )) GROUP BY "d"."id", "number_document", "type_document", "date_publication", "link") AS "wd"

query generated

SELECT COUNT(1) AS "zend_paginator_row_count" FROM (SELECT d.id,number_document ,type_document ,date_publication ,link FROM "key_word" AS "kw" INNER JOIN "word_document" AS "wd" ON kw.id = wd.key_word_id INNER JOIN "document" AS "d" ON d.id = wd.document_id INNER JOIN "type_document" AS "td" ON td.id = d.type_document_id WHERE (wd.id IN( 48, 21, 56, 47 )) GROUP BY "d"."id", "number_document", "type_document", "date_publication", "link") AS "wd" WHERE (wd.id IN( 48, 21, 56, 47 ))

if this ($isDistinct && count($columnParts) > 1) || count($groupParts) > 1 || !empty($havingParts)

resolved added $rowCount->reset(Zend_Db_Select::WHERE)

What is the exception message? What is the stack trace? Did you try and reproduce this with the latest version from SVN?

Message SQLSTATE[42703]: Undefined column: 7 ERROR: column wd.id does not exist LINE 9:"link") AS "wd" WHERE (wd.id IN( 48, 21, 56, 47 ))

tested with the latest version from SVN, version used 1.8.4

problem code generated SELECT COUNT(1) AS "zend_paginator_row_count" FROM ( SELECT id FROM test AS t WHERE test_id = 10 ) AS t WHERE test_id = 10

Note the last condition is duplicated, is necessary reset object select where.

the correct in my opine would

SELECT COUNT(1) AS "zend_paginator_row_count" FROM ( SELECT id FROM test AS t WHERE test_id = 10 ) AS t

sorry please, problem version used, with this if

if (($isDistinct && count($columnParts) > 1) || count($groupParts) > 1 || !empty($havingParts)) { $rowCount->reset(Zend_Db_Select::FROM);

            $rowCount->from($this->_select);

}

in version of the svn, creates a new object Zend_Db_Select

if (($isDistinct && count($columnParts) > 1) || count($groupParts) > 1 || !empty($havingParts)) { $rowCount = $db->select()->from($this->_select); }

Did that solve the problem?

resolved problem, version used was the problem

please, close issue

Thanks : )