summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-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");
}