Commit b74511bc authored by Maximilian Ruta's avatar Maximilian Ruta

Add testcase for limit/offset when selecting from a subselect

parent 61e1f860
...@@ -110,6 +110,20 @@ class ModifyLimitQueryTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -110,6 +110,20 @@ class ModifyLimitQueryTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->assertLimitResult(array(2, 1), $sql, 2, 2, false); $this->assertLimitResult(array(2, 1), $sql, 2, 2, false);
} }
public function testModifyLimitQueryFromSubSelect()
{
$this->_conn->insert('modify_limit_table', array('test_int' => 1));
$this->_conn->insert('modify_limit_table', array('test_int' => 2));
$this->_conn->insert('modify_limit_table', array('test_int' => 3));
$this->_conn->insert('modify_limit_table', array('test_int' => 4));
$sql = "SELECT * FROM (SELECT * FROM modify_limit_table) sub";
$this->assertLimitResult(array(4, 3, 2, 1), $sql, 10, 0, false);
$this->assertLimitResult(array(4, 3), $sql, 2, 0, false);
$this->assertLimitResult(array(2, 1), $sql, 2, 2, false);
}
public function assertLimitResult($expectedResults, $sql, $limit, $offset, $deterministic = true) public function assertLimitResult($expectedResults, $sql, $limit, $offset, $deterministic = true)
{ {
$p = $this->_conn->getDatabasePlatform(); $p = $this->_conn->getDatabasePlatform();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment