File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -214,19 +214,13 @@ protected function _update(string $table, array $values): string
214214 protected function _limit (string $ sql , bool $ offsetIgnore = false ): string
215215 {
216216 $ offset = (int ) ($ offsetIgnore === false ? $ this ->QBOffset : 0 );
217- if (version_compare ($ this ->db ->getVersion (), '12.1 ' , '>= ' )) {
218- // OFFSET-FETCH can be used only with the ORDER BY clause
219- if (empty ($ this ->QBOrderBy )) {
220- $ sql .= ' ORDER BY 1 ' ;
221- }
222217
223- return $ sql . ' OFFSET ' . $ offset . ' ROWS FETCH NEXT ' . $ this ->QBLimit . ' ROWS ONLY ' ;
218+ // OFFSET-FETCH can be used only with the ORDER BY clause
219+ if (empty ($ this ->QBOrderBy )) {
220+ $ sql .= ' ORDER BY 1 ' ;
224221 }
225222
226- $ this ->limitUsed = true ;
227- $ limitTemplateQuery = 'SELECT * FROM (SELECT INNER_QUERY.*, ROWNUM RNUM FROM (%s) INNER_QUERY WHERE ROWNUM < %d) ' . ($ offset !== 0 ? ' WHERE RNUM >= %d ' : '' );
228-
229- return sprintf ($ limitTemplateQuery , $ sql , $ offset + $ this ->QBLimit + 1 , $ offset );
223+ return $ sql . ' OFFSET ' . $ offset . ' ROWS FETCH NEXT ' . $ this ->QBLimit . ' ROWS ONLY ' ;
230224 }
231225
232226 /**
You can’t perform that action at this time.
0 commit comments