From a4d1783aaeea6a3e4a46084fde161ff7152fd2da Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Fri, 17 Oct 2014 12:59:28 -0700 Subject: Fixed bug mdev-6874. The method subselect_union_engine::no_rows() must take into account the fact that now unit->fake_select_lex is NULL for for select_union_direct objects. --- mysql-test/t/union.test | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 057c90b7c41..3305bea5b3b 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -1387,3 +1387,15 @@ DROP TABLE t1, t2; --echo # End of WL1763 tests +--echo # +--echo # Bug mdev-6874: crash with UNION ALL in a subquery +--echo # + +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,1), (2,8); + +SELECT * FROM t1 t1_1 LEFT JOIN t1 t1_2 ON ( t1_2.b = t1_1.a ) + WHERE t1_2.b NOT IN ( SELECT 4 UNION ALL SELECT 5 ); + +DROP TABLE t1; + -- cgit v1.2.1