Skip to content

Commit

Permalink
Cleaning up LIMIT / OFFSET code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
darkain committed Nov 9, 2018
1 parent aa43a28 commit 09119af
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions traits/pudlQuery.php
Expand Up @@ -632,14 +632,17 @@ protected function _limit($limit, $offset=false) {

$query = '';

if ($limit === false && $offset !== false)
$query .= ' LIMIT ' . ((1<<31)-1);
if ($limit === false && $offset !== false) {
$limit = ((1<<31)-1);
}

else if ($limit !== false)
if ($limit !== false) {
$query .= ' LIMIT ' . ((int)$limit);
}

if ($offset !== false)
if ($offset !== false) {
$query .= ' OFFSET ' . ((int)$offset);
}

return $query;
}
Expand Down

0 comments on commit 09119af

Please sign in to comment.