bug 779301

This commit is contained in:
Marc Delisle
2003-07-29 14:42:10 +00:00
parent 66279a58c8
commit af0540bbc5
2 changed files with 7 additions and 2 deletions

View File

@@ -24,6 +24,7 @@ $Source$
* serbian: big update,
thanks to Branislav Jovanovi<76> <branej@users.sourceforge.net> and
Mihailo Stefanovi<76> <mst@mikis.org>
* sql.php3: bug 779301: MySQL 3 and SELECT DISTINCT
2003-07-28 Alexander M. Turek <rabus@users.sourceforge.net>
* tbl_properties_structure.php3, css/phpmyadmin.css.php3: Use icons for

View File

@@ -237,6 +237,10 @@ else {
// $is_count is changed for more correct "LIMIT" clause
// appending in queries like
// "SELECT COUNT(...) FROM ... GROUP BY ..."
// TODO: detect all this with the parser, to avoid problems finding
// those strings in comments or backquoted identifiers
$is_explain = $is_count = $is_export = $is_delete = $is_insert = $is_affected = $is_show = $is_maint = $is_analyse = $is_group = $is_func = FALSE;
if ($is_select) { // see line 141
$is_group = eregi('(GROUP[[:space:]]+BY|HAVING|SELECT[[:space:]]+DISTINCT)[[:space:]]+', $sql_query);
@@ -378,6 +382,7 @@ else {
} else { // n o t " j u s t b r o w s i n g "
if (PMA_MYSQL_INT_VERSION < 40000) {
// TODO: detect DISTINCT in the parser
if (eregi('DISTINCT(.*)', $sql_query)) {
$count_what = 'DISTINCT ' . $analyzed_sql[0]['select_expr_clause'];
} else {
@@ -445,8 +450,7 @@ else {
if (PMA_MYSQL_INT_VERSION < 40000) {
if ($cnt_all_result = PMA_mysql_query($count_query)) {
if ($is_group) {
// if ($count_what == '*') {
if ($is_group && $count_what == '*') {
$unlim_num_rows = @mysql_num_rows($cnt_all_result);
} else {
$unlim_num_rows = PMA_mysql_result($cnt_all_result, 0, 'count');