@@ 100-112 (lines=13) @@ | ||
97 | $this->assertLimitResult(array(2), $sql, 1, 1); |
|
98 | } |
|
99 | ||
100 | public function testModifyLimitQuerySubSelect() |
|
101 | { |
|
102 | $this->_conn->insert('modify_limit_table', array('test_int' => 1)); |
|
103 | $this->_conn->insert('modify_limit_table', array('test_int' => 2)); |
|
104 | $this->_conn->insert('modify_limit_table', array('test_int' => 3)); |
|
105 | $this->_conn->insert('modify_limit_table', array('test_int' => 4)); |
|
106 | ||
107 | $sql = "SELECT modify_limit_table.*, (SELECT COUNT(*) FROM modify_limit_table) AS cnt FROM modify_limit_table ORDER BY test_int DESC"; |
|
108 | ||
109 | $this->assertLimitResult(array(4, 3, 2, 1), $sql, 10, 0); |
|
110 | $this->assertLimitResult(array(4, 3), $sql, 2, 0); |
|
111 | $this->assertLimitResult(array(2, 1), $sql, 2, 2); |
|
112 | } |
|
113 | ||
114 | public function testModifyLimitQueryFromSubSelect() |
|
115 | { |
|
@@ 114-126 (lines=13) @@ | ||
111 | $this->assertLimitResult(array(2, 1), $sql, 2, 2); |
|
112 | } |
|
113 | ||
114 | public function testModifyLimitQueryFromSubSelect() |
|
115 | { |
|
116 | $this->_conn->insert('modify_limit_table', array('test_int' => 1)); |
|
117 | $this->_conn->insert('modify_limit_table', array('test_int' => 2)); |
|
118 | $this->_conn->insert('modify_limit_table', array('test_int' => 3)); |
|
119 | $this->_conn->insert('modify_limit_table', array('test_int' => 4)); |
|
120 | ||
121 | $sql = "SELECT * FROM (SELECT * FROM modify_limit_table) sub ORDER BY test_int DESC"; |
|
122 | ||
123 | $this->assertLimitResult(array(4, 3, 2, 1), $sql, 10, 0); |
|
124 | $this->assertLimitResult(array(4, 3), $sql, 2, 0); |
|
125 | $this->assertLimitResult(array(2, 1), $sql, 2, 2); |
|
126 | } |
|
127 | ||
128 | public function testModifyLimitQueryLineBreaks() |
|
129 | { |