summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2018-04-23 13:26:49 +0200
committerAndrey Andreev <narf@devilix.net>2018-04-23 13:27:35 +0200
commitb070d923fee349b36c16010da3ff3c0222dddec3 (patch)
tree07ee9fa53511522e1fcacbc087c9689df1595bc6
parentd85c048f076246dc30f1d8ee0270c6b95ee25ba5 (diff)
[ci skip] Merge pull request #5471 from toonitw/patch-1
The value of limit can be zero
-rw-r--r--system/database/DB_driver.php2
-rw-r--r--system/database/DB_query_builder.php4
2 files changed, 3 insertions, 3 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 059849771..f8956f069 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1528,7 +1528,7 @@ abstract class CI_DB_driver {
return 'UPDATE '.$table.' SET '.implode(', ', $valstr)
.$this->_compile_wh('qb_where')
.$this->_compile_order_by()
- .($this->qb_limit ? ' LIMIT '.$this->qb_limit : '');
+ .($this->qb_limit !== FALSE ? ' LIMIT '.$this->qb_limit : '');
}
// --------------------------------------------------------------------
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index 5c0528a3f..3d0c329b0 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -2215,7 +2215,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
protected function _delete($table)
{
return 'DELETE FROM '.$table.$this->_compile_wh('qb_where')
- .($this->qb_limit ? ' LIMIT '.$this->qb_limit : '');
+ .($this->qb_limit !== FALSE ? ' LIMIT '.$this->qb_limit : '');
}
// --------------------------------------------------------------------
@@ -2365,7 +2365,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
.$this->_compile_order_by(); // ORDER BY
// LIMIT
- if ($this->qb_limit OR $this->qb_offset)
+ if ($this->qb_limit !== FALSE OR $this->qb_offset)
{
return $this->_limit($sql."\n");
}