From 7b137f15bd28727a62a6215cf21a92878948760e Mon Sep 17 00:00:00 2001
From: unknown <Sinisa@sinisa.nasamreza.org>
Date: Tue, 28 Jan 2003 18:55:52 +0200
Subject: A feature of doing automatick result buffering when INSERT is done
 from the select containing a table to be inserted to.

---
 mysql-test/r/insert.result    | 13 +++++++++++++
 mysql-test/r/subselect.result |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)

(limited to 'mysql-test/r')

diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index ebd34dd7668..3be04584749 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -64,3 +64,16 @@ use test_$1;
 create table t1 (c int);
 insert into test_$1.t1 set test_$1.t1.c = '1';
 drop database test_$1;
+use test;
+drop table if exists t1,t2,t3;
+create table t1(id1 int not null auto_increment primary key, t char(12));
+create table t2(id2 int not null, t char(12));
+create table t3(id3 int not null, t char(12), index(id3));
+select count(*) from t2;
+count(*)
+500
+insert into  t2 select t1.* from t1, t2 t, t3 where  t1.id1 = t.id2 and t.id2 = t3.id3;
+select count(*) from t2;
+count(*)
+25500
+drop table if exists t1,t2,t3;
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 04bf0575db3..ca3323adb6c 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -576,7 +576,6 @@ x
 3
 3
 INSERT INTO t1 (x) select (SELECT SUM(x)+2 FROM t1) FROM t2;
-You can't specify target table 't1' for update in FROM clause
 INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(x) FROM t2));
 select * from t1;
 x
@@ -584,6 +583,8 @@ x
 2
 3
 3
+11
+11
 0
 drop table t1, t2, t3;
 CREATE TABLE t1 (x int not null, y int, primary key (x));
-- 
cgit v1.2.1