From: jakubvrana Date: Fri, 24 Jul 2009 06:43:56 +0000 (+0000) Subject: Don't use SQL_CALC_FOUND_ROWS without limit X-Git-Tag: v3.0.0~632 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=dfc62bc75d484bbbd3214d519e1bd27363b148cb;p=adminer.git Don't use SQL_CALC_FOUND_ROWS without limit git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@895 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 1db65ae2..d4622e58 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -261,7 +261,7 @@ if (!$columns) { echo "\n"; echo "\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);