From 0f9efd54ceb0e2b42841f5eb15d30072d210bac2 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Fri, 3 Aug 2018 23:27:24 -0700 Subject: MDEV-16359 wrong result (extra rows) on the query with UNION and brackets Due to an obvious bug in st_select_lex_unit::reset_distinct() a union without duplicates of more than 2 selects could return a result set containing duplicate rows if this union was enclosed in (). --- mysql-test/main/brackets.result | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysql-test/main/brackets.result') diff --git a/mysql-test/main/brackets.result b/mysql-test/main/brackets.result index 194807290a0..479b74b69e4 100644 --- a/mysql-test/main/brackets.result +++ b/mysql-test/main/brackets.result @@ -207,4 +207,16 @@ a b 1 100 3 30 drop table t1; +# +# MDEV-16359: union with 3 selects in brackets +# +select 1 union select 1 union select 1; +1 +1 +(select 1 union select 1 union select 1); +1 +1 +((select 1) union (select 1) union (select 1)); +1 +1 # End of 10.4 tests -- cgit v1.2.1