summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2017-06-15 13:22:49 +0200
committerGitHub <noreply@github.com>2017-06-15 13:22:49 +0200
commitaf5c8960d80a9db362722ca675ffddb2079bbce9 (patch)
tree8156e7bef8af0565f287355772c9ec34593c9a11 /system/database
parentf51687fb99a905fe4f63918aaae672a2fdf20334 (diff)
parentbcd005fafa195d443db2419629bfeed99e49fc7e (diff)
Merge pull request #5155 from tianhe1986/develop_count_ignore_limit
Fix CI_DB_query_builder::count_all_results() returning wrong count with LIMIT/OFFSET
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 ef375227c..102ff4ac0 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -1488,7 +1488,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) OR ! empty($this->qb_cache_groupby))
+ $result = ($this->qb_distinct === TRUE OR ! empty($this->qb_groupby) OR ! empty($this->qb_cache_groupby) 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')));