summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2018-04-23 13:26:49 +0200
committerGitHub <noreply@github.com>2018-04-23 13:26:49 +0200
commitd9e066b3e462525ebb15089d6e99b01d5f29c8c8 (patch)
tree258442803952d147acacc42d8c23edf0f7d3d596
parentfb61fa32ff681eb6aba05d0966600bc8f896daac (diff)
parent1716c70d5a36285e8f531feecd99ba290353658c (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 037be739e..2f6bd7484 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1469,7 +1469,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 41148f63b..f9bfbb5b5 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -2287,7 +2287,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 : '');
}
// --------------------------------------------------------------------
@@ -2437,7 +2437,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");
}