summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authortianhe1986 <w1s2j3229@163.com>2017-06-15 11:58:54 +0200
committertianhe1986 <w1s2j3229@163.com>2017-06-15 11:58:54 +0200
commitbcd005fafa195d443db2419629bfeed99e49fc7e (patch)
treea10393932a5cb1f8d6eb7b0e3b7e2438d6376c96 /system
parentf8df72efa0e085f3f8fbbd560b8b74704d5efec5 (diff)
Getting right num of rows with LIMIT usage.
Signed-off-by: tianhe1986 <w1s2j3229@163.com>
Diffstat (limited to 'system')
-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')));