diff --git a/libraries/display_tbl.lib.php3 b/libraries/display_tbl.lib.php3 index 9ab4e3867..07057bf86 100644 --- a/libraries/display_tbl.lib.php3 +++ b/libraries/display_tbl.lib.php3 @@ -192,7 +192,7 @@ if (!defined('__LIB_DISPLAY_TBL__')){ { global $lang, $server, $db, $table; global $goto; - global $num_rows, $unlim_num_rows, $pos, $sessionMaxRows; + global $num_rows, $unlim_num_rows, $pos, $session_max_rows; global $dontlimitchars; ?> @@ -201,7 +201,7 @@ if (!defined('__LIB_DISPLAY_TBL__')){ 0 && $sessionMaxRows != 'all') { + if ($pos > 0 && $session_max_rows != 'all') { // loic1: patch #474210 from Gosha Sakovich - part 1 if ($GLOBALS['cfgNavigationBarIconic']) { $caption1 = '<<'; @@ -223,7 +223,7 @@ if (!defined('__LIB_DISPLAY_TBL__')){ - + /> @@ -237,7 +237,7 @@ if (!defined('__LIB_DISPLAY_TBL__')){ - + /> @@ -252,7 +252,7 @@ if (!defined('__LIB_DISPLAY_TBL__')){
+ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', 1) && checkFormElementInRange(this, 'pos', 0, ))"> @@ -261,7 +261,7 @@ if (!defined('__LIB_DISPLAY_TBL__')){ - +
@@ -271,8 +271,8 @@ if (!defined('__LIB_DISPLAY_TBL__')){ = $sessionMaxRows - && $sessionMaxRows != 'all') { + if (($pos + $session_max_rows < $unlim_num_rows) && $num_rows >= $session_max_rows + && $session_max_rows != 'all') { // loic1: patch #474210 from Gosha Sakovich - part 2 if ($GLOBALS['cfgNavigationBarIconic']) { $caption3 = ' > '; @@ -295,7 +295,7 @@ if (!defined('__LIB_DISPLAY_TBL__')){ - + /> @@ -303,14 +303,14 @@ if (!defined('__LIB_DISPLAY_TBL__')){
+ onsubmit="return = $session_max_rows) ? 'true' : 'false'); ?>"> - - + + /> @@ -334,7 +334,7 @@ if (!defined('__LIB_DISPLAY_TBL__')){ - + @@ -382,7 +382,7 @@ if (!defined('__LIB_DISPLAY_TBL__')){ { global $lang, $server, $db, $table; global $goto; - global $sql_query, $num_rows, $pos, $sessionMaxRows; + global $sql_query, $num_rows, $pos, $session_max_rows; global $dontlimitchars; ?> @@ -402,7 +402,7 @@ if (!defined('__LIB_DISPLAY_TBL__')){ . '&table=' . urlencode($table) . '&sql_query=' . $encoded_query . '&pos=' . $pos - . '&sessionMaxRows=' . $sessionMaxRows + . '&session_max_rows=' . $session_max_rows . '&pos=' . $pos . '&goto=' . $goto . '&dontlimitchars=' . (($dontlimitchars) ? 0 : 1); @@ -514,7 +514,7 @@ if (!defined('__LIB_DISPLAY_TBL__')){ . '&db=' . urlencode($db) . '&table=' . urlencode($table) . '&pos=' . $pos - . '&sessionMaxRows=' . $sessionMaxRows + . '&session_max_rows=' . $session_max_rows . '&dontlimitchars' . $dontlimitchars . '&sql_query=' . urlencode($sorted_sql_query); // 2.1.5 Displays the sorting url @@ -901,7 +901,7 @@ if (!defined('__LIB_DISPLAY_TBL__')){ if (!isset($pos)) { $pos = 0; } - if ($GLOBALS['sessionMaxRows'] == 'all') { + if ($GLOBALS['session_max_rows'] == 'all') { $pos_next = 0; $pos_prev = 0; } else { @@ -931,7 +931,7 @@ if (!defined('__LIB_DISPLAY_TBL__')){ } else { $selectstring = ''; } - $last_shown_rec = ($GLOBALS['sessionMaxRows'] == 'all' || $pos_next > $total) + $last_shown_rec = ($GLOBALS['session_max_rows'] == 'all' || $pos_next > $total) ? $total : $pos_next; show_message($GLOBALS['strShowingRecords'] . " $pos - $last_shown_rec ($total " . $GLOBALS['strTotal'] . $selectstring . ')'); diff --git a/sql.php3 b/sql.php3 index 54e1bddbf..fb2f1fb00 100755 --- a/sql.php3 +++ b/sql.php3 @@ -161,10 +161,10 @@ else { $reload = 1; } // Gets the number of rows per page - if (!isset($sessionMaxRows)){ - $sessionMaxRows = $cfgMaxRows; - } else if ($sessionMaxRows != 'all') { - $cfgMaxRows = $sessionMaxRows; + if (!isset($session_max_rows)){ + $session_max_rows = $cfgMaxRows; + } else if ($session_max_rows != 'all') { + $cfgMaxRows = $session_max_rows; } $is_explain = $is_select = $is_count = $is_export = $is_delete = $is_insert = $is_affected = $is_show = $is_maint = FALSE; @@ -190,7 +190,7 @@ else { // Do append a "LIMIT" clause? if (isset($pos) - && (!$cfgShowAll || $sessionMaxRows != 'all') + && (!$cfgShowAll || $session_max_rows != 'all') && ($is_select && !($is_count || $is_export) && eregi(' FROM ', $sql_query)) && !eregi(' LIMIT[ 0-9,]+$', $sql_query)) { $sql_limit_to_append = " LIMIT $pos, $cfgMaxRows"; diff --git a/tbl_select.php3 b/tbl_select.php3 index 67ee01030..9999b260f 100755 --- a/tbl_select.php3 +++ b/tbl_select.php3 @@ -59,7 +59,7 @@ if (!isset($param) || $param[0] == '') {
  • - +
  • @@ -190,7 +190,7 @@ else { . '&table=' . urlencode($table) . '&sql_query=' . urlencode($sql_query) . '&pos=0' - . '&sessionMaxRows=' . $sessionMaxRows + . '&session_max_rows=' . $session_max_rows . '&goto='. $goto; header('Location: ' . $cfgPmaAbsoluteUri . 'sql.php3?' . $url_query); }