Commit 3d37b67b authored by unknown's avatar unknown

Fix for LP bug#998516

If we did nothing in resolving unique table conflict we should not retry (it leed to infinite loop).
Now we retry (recheck) unique table check only in case if we materialized a table.
parent 6d41fa0d
......@@ -2087,6 +2087,24 @@ a b
drop table t1;
set optimizer_switch=@save978847_optimizer_switch;
#
# LP bug998516 Server hangs on INSERT .. SELECT with derived_merge,
# FROM subquery, UNION
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (3),(4);
INSERT INTO t1 SELECT * FROM ( SELECT * FROM t1 ) AS alias UNION SELECT * FROM t2;
select * from t1;
a
1
2
1
2
3
4
drop table t1,t2;
#
# end of 5.3 tests
#
set optimizer_switch=@exit_optimizer_switch;
......
......@@ -1437,6 +1437,19 @@ drop table t1;
set optimizer_switch=@save978847_optimizer_switch;
--echo #
--echo # LP bug998516 Server hangs on INSERT .. SELECT with derived_merge,
--echo # FROM subquery, UNION
--echo #
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (3),(4);
INSERT INTO t1 SELECT * FROM ( SELECT * FROM t1 ) AS alias UNION SELECT * FROM t2;
select * from t1;
drop table t1,t2;
--echo #
--echo # end of 5.3 tests
--echo #
......
......@@ -1739,8 +1739,8 @@ TABLE_LIST* unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list,
("convert merged to materialization to resolve the conflict"));
derived->change_refs_to_fields();
derived->set_materialized_derived();
goto retry;
}
goto retry;
}
DBUG_RETURN(res);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment