diff options
author | Andrey Andreev <narf@devilix.net> | 2017-01-03 12:18:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-03 12:18:27 +0100 |
commit | 71b4a45a4de4ffd8e502d9632ffb6c5c099da94e (patch) | |
tree | 5dcfdde2d114bb8356bfe5b4413c4d1ae2483e7c | |
parent | b3f2e9bcc34c2046a56f34d2bc67dc65dbb61185 (diff) | |
parent | 8112b5341ec02d38e448e767ab95196df9a84a74 (diff) |
Merge pull request #4958 from boxsnake/develop
Fix a bug where QB count_all_results() doesn't take into account qb_cache_orderby
-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 661f5fe69..3f1a8021a 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 ! empty($this->qb_cache_groupby)) ? $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'))); |