diff options
author | Alex Fang <deeno@qq.com> | 2016-12-22 05:49:45 +0100 |
---|---|---|
committer | Alex Fang <deeno@qq.com> | 2016-12-22 05:49:45 +0100 |
commit | a927ae4ee86fb6727ac340e7b96aee6f82b5542b (patch) | |
tree | 0fb6bd39f630826190e959d0fa20c2bdc78401a8 /system/database/DB_query_builder.php | |
parent | 62adbbd6cb2bc56258817efbc8f201250de6b64d (diff) |
Fix bug: DB_query_builder do not add parenthesis for cached group_by
Diffstat (limited to 'system/database/DB_query_builder.php')
-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 b88ec956a..6d165fc79 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -1402,7 +1402,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { $this->qb_orderby = NULL; } - $result = ($this->qb_distinct === TRUE OR ! empty($this->qb_groupby)) + $result = ($this->qb_distinct === TRUE OR ! empty($this->qb_groupby) OR in_array('groupby', $this->qb_cache_exists)) ? $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'))); |