Skip to content

Commit

Permalink
Fix issue #59
Browse files Browse the repository at this point in the history
  • Loading branch information
narfbg committed Oct 26, 2012
1 parent 5bf1997 commit b05f506
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion system/database/DB_query_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,9 @@ public function count_all_results($table = '')
$this->from($table);
}

$result = $this->query($this->_compile_select($this->_count_string.$this->protect_identifiers('numrows')));
$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')));
$this->_reset_select();

if ($result->num_rows() === 0)
Expand Down
1 change: 1 addition & 0 deletions user_guide_src/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ Bug fixes for 3.0
- Fixed a bug (#1146) - :doc:`Download Helper <helpers/download_helper>` function ``force_download()`` incorrectly sent *Cache-Control* directives *pre-check* and *post-check* to Internet Explorer.
- Fixed a bug (#1811) - :doc:`URI Library <libraries/uri>` didn't properly cache segments for ``uri_to_assoc()`` and ``ruri_to_assoc()``.
- Fixed a bug (#1506) - :doc:`Form Helpers <helpers/form_helper>` set empty *name* attributes.
- Fixed a bug (#59) - :doc:`Query Builder <database/query_builder>` method ``count_all_results()`` ignored the DISTINCT clause.

Version 2.1.3
=============
Expand Down

0 comments on commit b05f506

Please sign in to comment.