summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-07-29 10:42:28 +0200
committerAndrey Andreev <narf@devilix.net>2016-07-29 10:42:28 +0200
commitacc6481807fc9cac56b7c1de16239d98af711575 (patch)
treef672134fbe7828b45ec3e826185353704015610f /system/database
parentb9f53a8d7a96bad5c6f1ff7e41a075fcb5d8fb5c (diff)
Fix #4737
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_query_builder.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index 713bf18f3..7a008eeb8 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -1271,7 +1271,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
*/
protected function _limit($sql)
{
- return $sql.' LIMIT '.($this->qb_offset ? $this->qb_offset.', ' : '').$this->qb_limit;
+ return $sql.' LIMIT '.($this->qb_offset ? $this->qb_offset.', ' : '').(int) $this->qb_limit;
}
// --------------------------------------------------------------------
@@ -2340,7 +2340,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
.$this->_compile_order_by(); // ORDER BY
// LIMIT
- if ($this->qb_limit)
+ if ($this->qb_limit OR $this->qb_offset)
{
return $this->_limit($sql."\n");
}