diff options
author | Najdanovic Ivan <najdanovicivan@gmail.com> | 2019-09-13 15:47:14 +0200 |
---|---|---|
committer | Najdanovic Ivan <najdanovicivan@gmail.com> | 2019-09-13 15:47:14 +0200 |
commit | 304752dfa33e65e5fab722b5f4799f6c5bf16560 (patch) | |
tree | 90a9b4c1520f9873a8e7d1b51135fb065c33566a /system/database | |
parent | d5328adebff867b2757c74190eec5073ad56386f (diff) |
Fix count_all_result if QB query contains Having
Signed-off-by: Najdanovic Ivan <najdanovicivan@gmail.com>
Diffstat (limited to 'system/database')
-rw-r--r-- | system/database/DB_query_builder.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index 12949c7dc..78e8018c7 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -1484,7 +1484,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { $qb_cache_orderby = $this->qb_cache_orderby; $this->qb_orderby = $this->qb_cache_orderby = array(); - $result = ($this->qb_distinct === TRUE OR ! empty($this->qb_groupby) OR ! empty($this->qb_cache_groupby) OR $this->qb_limit OR $this->qb_offset) + $result = ($this->qb_distinct === TRUE OR ! empty($this->qb_groupby) OR ! empty($this->qb_cache_groupby) OR ! empty($this->qb_having) OR $this->qb_limit OR $this->qb_offset) ? $this->query($this->_count_string.$this->protect_identifiers('numrows')."\nFROM (\n".$this->_compile_select()."\n) CI_count_all_results") : $this->query($this->_compile_select($this->_count_string.$this->protect_identifiers('numrows'))); |