Commit ead6c5b4 authored by Marcin Haba's avatar Marcin Haba
Browse files

baculum: Fix OFFSET parameter in PHP framework

Ticket in the PRADO framework GitHub project:

Support for OFFSET parameter without LIMIT clause in SQL query for TActiveRecord

https://github.com/pradosoft/prado/issues/819
parent bb910baa
......@@ -144,7 +144,7 @@ class TSqlCriteria extends \Prado\TComponent
// [LIMIT {[offset,] row_count | row_count OFFSET offset}]
// See: http://dev.mysql.com/doc/refman/5.0/en/select.html
if (preg_match('/ORDER\s+BY\s+(.*?)(?=LIMIT)|ORDER\s+BY\s+(.*?)$/i', $value, $matches) > 0) {
if (preg_match('/ORDER\s+BY\s+(.*?)(?=\s+(?:LIMIT|OFFSET))|ORDER\s+BY\s+(.*?)$/i', $value, $matches) > 0) {
// condition contains ORDER BY
$value = str_replace($matches[0], '', $value);
if (strlen($matches[1]) > 0) {
......
Supports Markdown
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