diff options
author | unknown <evgen@moonbone.local> | 2005-09-15 21:34:11 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2005-09-15 21:34:11 +0400 |
commit | 36d163d6cf1f4ce522e081c378129f9723760d15 (patch) | |
tree | 0129651e804ae774cb6aa27282c6ebf228c4377b /sql/sql_select.cc | |
parent | 02fce1c316e7a33748eb7ccf13a49fbaa2926ee6 (diff) | |
download | mariadb-git-36d163d6cf1f4ce522e081c378129f9723760d15.tar.gz |
Fix bug#12887 Distinct is not always applied after rollup
For queries with GROUP BY and without hidden GROUP BY fields DISTINCT is
optimized away becuase such queries produce result set without duplicates.
But ROLLUP can add rows which may be same to some rows and this fact was
ignored.
Added check so if ROLLUP is present DISTINCT can't be optimized away.
sql/sql_select.cc:
Fix bug #12887 Distinct is not always applied after rollup
mysql-test/r/olap.result:
Test case for bug #12887 Distinct is not always applied after rollup
mysql-test/t/olap.test:
Test case for bug #12887 Distinct is not always applied after rollup
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index f702e531a4d..59b82b53b32 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -618,7 +618,7 @@ JOIN::optimize() } if (group_list || tmp_table_param.sum_func_count) { - if (! hidden_group_fields) + if (! hidden_group_fields && rollup.state == ROLLUP::STATE_NONE) select_distinct=0; } else if (select_distinct && tables - const_tables == 1) |