ZF2-416: Call to undefined method Zend\Db\Sql\Select::__toString() In Paginator\Adaptor\DbSelect

Description

During an experiment with the paginator adapters from master, I came across an issue resulting in the following error: Fatal error: Call to undefined method Zend\Db\Sql\Select::__toString() in /var/www/zf/ZendSkeletonApplication/vendor/ZF2/library/Zend/Paginator/Adapter/DbSelect.php on line 154

My Sample code: $dbAdapter = new \Zend\Db\Adapter\Adapter( array( 'driver' => 'Pdo_Sqlite', 'database' => DIR . '/../../../posts.db3' ) );

        $sql = new \Zend\Db\Sql\Sql($dbAdapter);
        $select = $sql->select()->from('posts');

        $paginatorAdapter = new \Zend\Paginator\Adapter\DbSelect($select);

        $p = new \Zend\Paginator\Paginator($paginatorAdapter);
        $p->setCurrentPageNumber($pageNumber);
        $p->setItemCountPerPage(self::PER_PAGE);    // this line causes the error below

Comments

This was resolved in rc4.