mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-16990:server crashes in base_list_iterator::next
When we have a query which has implicit_grouping then we are sure that we would end up with only one row so there is no point to do DISTINCT computation
This commit is contained in:
@@ -3314,3 +3314,15 @@ COUNT(DISTINCT t2.a2) rank() OVER (ORDER BY t2.b1)
|
||||
1 2
|
||||
1 3
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# MDEV-16990: server crashes in base_list_iterator::next
|
||||
#
|
||||
CREATE TABLE t1(i int);
|
||||
insert into t1 values (1),(2);
|
||||
SELECT DISTINCT row_number() OVER (), MAX(1) FROM t1;
|
||||
row_number() OVER () MAX(1)
|
||||
1 1
|
||||
SELECT DISTINCT BIT_AND(0) OVER (), MAX(1) FROM t1;
|
||||
BIT_AND(0) OVER () MAX(1)
|
||||
0 1
|
||||
drop table t1;
|
||||
|
@@ -2082,3 +2082,13 @@ SELECT COUNT(DISTINCT t2.a2),
|
||||
rank() OVER (ORDER BY t2.b1)
|
||||
FROM t2 ,t1 GROUP BY t2.b1 ORDER BY t1.a1;
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-16990: server crashes in base_list_iterator::next
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(i int);
|
||||
insert into t1 values (1),(2);
|
||||
SELECT DISTINCT row_number() OVER (), MAX(1) FROM t1;
|
||||
SELECT DISTINCT BIT_AND(0) OVER (), MAX(1) FROM t1;
|
||||
drop table t1;
|
||||
|
@@ -2731,7 +2731,7 @@ bool JOIN::make_aggr_tables_info()
|
||||
remove_duplicates() assumes there is a preceding computation step (and
|
||||
in the degenerate join, there's none)
|
||||
*/
|
||||
if (top_join_tab_count)
|
||||
if (top_join_tab_count && tables_list)
|
||||
curr_tab->distinct= true;
|
||||
|
||||
having= NULL;
|
||||
|
Reference in New Issue
Block a user