ZF-10599: Wrong limit statement when using db_select and paginator

Description

I have connection to MSSql.

Then I'm triing to create select for paginator select adapter from several other selects. $select = $db->select()->union($selects); echo $select->__toString(); //looks fine, and executing in sql anager successfully

But when I use this select in paginator I have wrong rows. Because "select top 10" in query affects only on first select in unioned query.

Sorry for my english.

Comments

there is also bug in limitpage function for adapter sqlsrv

ex: if there are 3 records in table if we use limitpage(2,2) return 2 records instead of 1 records

Thank you for this solution. But I think, this issue have to be fixed in ZF (Zend_Db_Select).