From 3da06a55004360a793a4d6c66748c63c2a6836a8 Mon Sep 17 00:00:00 2001 From: "dlenev@brandersnatch.localdomain" <> Date: Wed, 16 Mar 2005 12:13:35 +0300 Subject: Fixed behavior of LOAD DATA with subqueries in SET clause. The idea is to use TABLE_LIST::lock_type for passing type of lock for target table to mysql_load() instead of using LEX::lock_option (which were rewritten by first subselect in SET clause). This should also fix potential problem with LOAD DATA in SP (it is important for them to have right lock_type in the table list by the end of statement parsing). --- mysql-test/r/loaddata.result | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'mysql-test/r/loaddata.result') diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index 562b855f3e3..d76fff372f5 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1, t2; create table t1 (a date, b date, c date not null, d date); load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; Warnings: @@ -111,4 +111,12 @@ a b c 5 6 5+6+123+6+NIL load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b); ERROR HY000: Can't load value from file with fixed size rows to variable -drop table t1; +create table t2 (num int primary key, str varchar(10)); +insert into t2 values (10,'Ten'), (15,'Fifteen'); +truncate table t1; +load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n); +select * from t1; +a b c +10 NULL Ten +15 NULL Fifteen +drop table t1, t2; -- cgit v1.2.1