diff --git a/ChangeLog b/ChangeLog index 3e0fd01f0..b2333bf50 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2004-09-29 Marc Delisle + * sql.php, libraries/common.lib.php: bug #1036678, incorrect appending + of LIMIT to queries + 2004-09-29 Michal Čihař * tbl_addfield.php, tbl_create.php, tbl_properties.inc.php, lang/*: Better wording when adding fields (bug #991096). diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 26522b18b..2e86524aa 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -1579,6 +1579,19 @@ if (typeof(document.getElementById) != 'undefined' } else { $query_base = $local_query; } + + // Here we append the LIMIT added for navigation, to + // enable its display. Adding it higher in the code + // to $local_query would create a problem when + // using the Refresh or Edit links + + // FIXME: what would be the best to do when someone + // hits Refresh: use the current LIMITs ? + + if (isset($GLOBALS['sql_limit_to_append'])) { + $query_base .= $GLOBALS['sql_limit_to_append']; + } + if (!empty($GLOBALS['show_as_php'])) { $query_base = '$sql = \'' . $query_base; } else if (!empty($GLOBALS['validatequery'])) { diff --git a/sql.php b/sql.php index 0a1e5b707..cd63adafa 100644 --- a/sql.php +++ b/sql.php @@ -326,8 +326,6 @@ else { } else { $display_query = $display_query . $sql_limit_to_append; } - } else { - $display_query = $full_sql_query; } } else { $full_sql_query = $sql_query; @@ -468,7 +466,6 @@ else { // (SELECT $count_query = PMA_SQP_formatHtml($parsed_sql, 'query_only', 0, $analyzed_sql[0]['position_of_first_select'] + 1); $count_query .= ' SQL_CALC_FOUND_ROWS '; - // add everything that was after the first SELECT $count_query .= PMA_SQP_formatHtml($parsed_sql, 'query_only', $analyzed_sql[0]['position_of_first_select']+1); } else { // PMA_MYSQL_INT_VERSION < 40000