summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2017-10-03 13:17:55 +0200
committerGitHub <noreply@github.com>2017-10-03 13:17:55 +0200
commit308eb0f8af8811bfc95c94036be53ed8974b64b0 (patch)
tree0015673281dd02aa73d78450933c229edf655de5
parentc495515f115685fbcb4180f4305ec2406144ca83 (diff)
parentcf3924ec3f19fb6a3f4782cfe55e0c6314bcf94d (diff)
Merge pull request #5282 from pgee70/patch-1
Fix ORDER BY clauses being reset by count_all_results()
-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 81603bf31..72bd4e721 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -1405,7 +1405,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
// for selecting COUNT(*) ...
$qb_orderby = $this->qb_orderby;
$qb_cache_orderby = $this->qb_cache_orderby;
- $this->qb_orderby = $this->qb_cache_orderby = NULL;
+ $this->qb_orderby = $this->qb_cache_orderby = array();
$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")