summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2017-01-03 12:18:27 +0100
committerAndrey Andreev <narf@devilix.net>2017-01-03 12:19:00 +0100
commit2cae5587fed1f1b448a48e978ab28f0af3e0ec88 (patch)
treef89e8162f51de1722efb0e22bc81ef0414451fcf /system/database
parent593ce680b87fadb05af6ba13c857ef8b16303bcf (diff)
Merge pull request #4958 from boxsnake/develop
Fix a bug where QB count_all_results() doesn't take into account qb_cache_orderby
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_query_builder.php2
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')));