From 69ce2fe4843ccb14ae2c2aa8db37f57841d3f231 Mon Sep 17 00:00:00 2001 From: Jehong Ahn Date: Thu, 12 Apr 2018 16:36:38 +0900 Subject: qb_limit can be zero --- system/database/DB_query_builder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/DB_query_builder.php') diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index 744c4970e..77f6cfe89 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"); } -- cgit v1.2.3-24-g4f1b From 1716c70d5a36285e8f531feecd99ba290353658c Mon Sep 17 00:00:00 2001 From: Jehong Ahn Date: Wed, 18 Apr 2018 23:56:29 +0900 Subject: Remove the extra parentheses --- system/database/DB_query_builder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/DB_query_builder.php') diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index 77f6cfe89..8f52ff1d1 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 !== FALSE) ? ' LIMIT '.$this->qb_limit : ''); + .($this->qb_limit !== FALSE ? ' LIMIT '.$this->qb_limit : ''); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b