diff --git a/ChangeLog b/ChangeLog index c1644040e..900e80408 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ $Source$ 2006-05-30 Marc Delisle * lang/french*: updates * querywindow.php: $is_superuser was not defined + * sql.php: bug #1490422, lost connection to MySQL server (SELECT DISTINCT) 2006-05-30 Michal Čihař * libraries/export/sql.php: Fix handling of backquotes (bug #1497239). diff --git a/sql.php b/sql.php index 6bc312c73..0de583e50 100644 --- a/sql.php +++ b/sql.php @@ -520,6 +520,11 @@ else { $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); + // ensure there is no semicolon at the end of the + // count query because we'll probably add + // a LIMIT 1 clause after it + $count_query = rtrim($count_query); + $count_query = rtrim($count_query, ';'); } else { // PMA_MYSQL_INT_VERSION < 40000 if (!empty($analyzed_sql[0]['from_clause'])) {