Skip to content

Commit

Permalink
Don't use SQL_CALC_FOUND_ROWS without limit
Browse files Browse the repository at this point in the history
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@895 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information
jakubvrana committed Jul 24, 2009
1 parent ba9c9a5 commit dfc62bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adminer/select.inc.php
Expand Up @@ -261,7 +261,7 @@ function apply_sql_function($function, $column) {
echo "</div></fieldset>\n";
echo "</form>\n";

$query = "SELECT " . (count($group) < count($select) ? "SQL_CALC_FOUND_ROWS " : "") . $from . $group_by . (strlen($limit) ? " LIMIT " . intval($limit) . (intval($_GET["page"]) ? " OFFSET " . ($limit * $_GET["page"]) : "") : "");
$query = "SELECT " . (intval($limit) && count($group) < count($select) ? "SQL_CALC_FOUND_ROWS " : "") . $from . $group_by . (strlen($limit) ? " LIMIT " . intval($limit) . (intval($_GET["page"]) ? " OFFSET " . ($limit * $_GET["page"]) : "") : "");
echo adminer_select_query($query);

$result = $dbh->query($query);
Expand Down

0 comments on commit dfc62bc

Please sign in to comment.