From fa41126c37f536b42c9e47684a3ba762231bd049 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 1 Feb 2018 20:59:05 +0100 Subject: [PATCH] Don't count rows if we reached the end --- adminer/select.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 8c6ba242..81c387fc 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -445,8 +445,8 @@ if (!$columns && support("table")) { if (($rows || $page) && !is_ajax()) { $exact_count = true; if ($_GET["page"] != "last") { - if ($limit == "") { - $found_rows = count($rows); + if ($limit == "" || (count($rows) < $limit && ($rows || !$page))) { + $found_rows = ($page ? $page * $limit : 0) + count($rows); } elseif ($jush != "sql" || !$is_group) { $found_rows = ($is_group ? false : found_rows($table_status, $where)); if ($found_rows < max(1e4, 2 * ($page + 1) * $limit)) {