```
        $mockDriver = $this->getMock('Zend\Db\Adapter\Driver\DriverInterface');
        $mockConnection = $this->getMock('Zend\Db\Adapter\Driver\ConnectionInterface');
        $mockDriver->expects($this->any())->method('checkEnvironment')->will($this->returnValue(true));
        $mockDriver->expects($this->any())->method('getConnection')->will($this->returnValue($mockConnection));
        $mockPlatform = $this->getMock('Zend\Db\Adapter\Platform\PlatformInterface');
        $mockStatement = $this->getMock('Zend\Db\Adapter\Driver\StatementInterface');
        $mockDriver->expects($this->any())->method('createStatement')->will($this->returnValue($mockStatement));

        $adapter = new \Zend\Db\Adapter\Adapter($mockDriver, $mockPlatform);

        $sql = new \Zend\Db\Sql\Sql($adapter);
        $sql->getSqlPlatform()->setTypeDecorator('Zend\Db\Sql\Select', new \Zend\Db\Sql\Platform\Mysql\SelectDecorator);
        $query = $sql->getSqlStringForSqlObject($select46, new TrustingSql92Platform());
```
this code (for unitTests) use ```Zend\Db\Sql\Platform\Mysql\SelectDecorator::processLimit```

if you code not use decorators - this is the bug, see this https://github.com/zendframework/zf2/pull/5306 - this fix for decorators, subqueries, etc.

@ralphschindler are you planing to merge https://github.com/zendframework/zf2/pull/5306 ?