]> git.joonet.de Git - adminer.git/commitdiff
Don't count rows if we reached the end
authorJakub Vrana <jakub@vrana.cz>
Thu, 1 Feb 2018 19:59:05 +0000 (20:59 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 1 Feb 2018 19:59:05 +0000 (20:59 +0100)
adminer/select.inc.php

index 8c6ba242583d04beca2225ed778154a6e33e36f4..81c387fce362e60aa16e9dd32b6d0a1f83d81c90 100644 (file)
@@ -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)) {