add a judgment of whether reset select
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index 894d7dd..3d4a857 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -1366,10 +1366,11 @@
 		$result = ($this->qb_distinct === TRUE)
 			? $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')));
-        if($reset)
-        {
-		    $this->_reset_select();
-        }
+
+                if($reset)
+                {
+		        $this->_reset_select();
+                }
 
 		if ($result->num_rows() === 0)
 		{