From 8ec7e8587f1f2afc65227b05ff75ac071628dd75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 8 Feb 2012 10:02:22 +0100 Subject: [PATCH 1/3] Avoid undefined variable when showing all records --- libraries/display_tbl.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 75698ade99..26055a1807 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -308,6 +308,7 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, $id_for_di } // end move back + $nbTotalPage = 1; //page redirection // (unless we are showing all records) if ('all' != $_SESSION['tmp_user_values']['max_rows']) { //if1 From 9bb55351993584eb8d477bbbb4ae21853a1c99e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 8 Feb 2012 10:02:45 +0100 Subject: [PATCH 2/3] Provide Show all button for reasonably small tables --- libraries/display_tbl.lib.php | 2 +- sql.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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']) From de1dda780256e1e38e50113666a33dfae609dad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 8 Feb 2012 10:06:06 +0100 Subject: [PATCH 3/3] Document change in Show all and explain reasons for limiting it --- Documentation.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation.html b/Documentation.html index e2cd0850a1..9369d87d35 100644 --- a/Documentation.html +++ b/Documentation.html @@ -1658,7 +1658,10 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE
$cfg['ShowAll'] boolean
Defines whether a user should be displayed a - "show all (rows)" button in browse mode or not.
+ "Show all" button in browse mode or not in all cases. + By default it is shown only on small tables (less than 5 × + $cfg['MaxRows'] rows) to avoid performance + issues while getting too many rows.
$cfg['MaxRows'] integer
Number of rows displayed when browsing a result set and no LIMIT