From 5aa315e23a86dc5d376df09a11654799a7a80843 Mon Sep 17 00:00:00 2001 From: "ingo@mysql.com" <> Date: Wed, 7 Dec 2005 19:52:26 +0100 Subject: BUG#5390 - problems with merge tables Problem #1: INSERT...SELECT, Version for 4.1. INSERT ... SELECT with the same table on both sides (hidden below a MERGE table) does now work by buffering the select result. The duplicate detection works now after open_and_lock_tables() on the locks. I did not find a test case that failed without the change in sql_update.cc. I made the change anyway as it should in theory fix a possible MERGE table problem with multi-table update. --- mysql-test/r/merge.result | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'mysql-test/r/merge.result') diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 3035908688a..038ea43cabc 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -717,3 +717,52 @@ SELECT b FROM t2; b 3 DROP TABLE t1, t2; +create table t1(a int); +create table t2(a int); +insert into t1 values (1); +insert into t2 values (2); +create table t3 (a int) engine=merge union=(t1, t2) insert_method=first; +select * from t3; +a +1 +2 +insert t2 select * from t2; +select * from t2; +a +2 +2 +insert t3 select * from t1; +select * from t3; +a +1 +1 +2 +2 +insert t1 select * from t3; +select * from t1; +a +1 +1 +1 +1 +2 +2 +select * from t2; +a +2 +2 +select * from t3; +a +1 +1 +1 +1 +2 +2 +2 +2 +check table t1, t2; +Table Op Msg_type Msg_text +test.t1 check status OK +test.t2 check status OK +drop table t1, t2, t3; -- cgit v1.2.1