diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 26055a1807..63121ac73a 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -346,7 +346,7 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, $id_for_di } //_if1 // Display the "Show all" button if allowed - if ($GLOBALS['cfg']['ShowAll'] && ($num_rows < $unlim_num_rows)) { + if (($num_rows < $unlim_num_rows) && ($GLOBALS['cfg']['ShowAll'] || ($GLOBALS['cfg']['MaxRows'] * 5 >= $unlim_num_rows))) { echo "\n"; ?> diff --git a/sql.php b/sql.php index d736bdf58c..42d72caae2 100644 --- a/sql.php +++ b/sql.php @@ -448,7 +448,7 @@ if ($GLOBALS['cfg']['RememberSorting'] } // Do append a "LIMIT" clause? -if ((! $cfg['ShowAll'] || $_SESSION['tmp_user_values']['max_rows'] != 'all') +if (($_SESSION['tmp_user_values']['max_rows'] != 'all') && ! ($is_count || $is_export || $is_func || $is_analyse) && isset($analyzed_sql[0]['queryflags']['select_from']) && ! isset($analyzed_sql[0]['queryflags']['offset'])