summaryrefslogtreecommitdiff
path: root/mysql-test/main/invisible_field.test
diff options
context:
space:
mode:
authorSachin Setiya <sachinsetia1001@gmail.com>2018-04-26 16:49:27 +0530
committersachin <sachin.setiya@maridb.com>2018-05-15 12:38:44 +0530
commit9ee5406e2f3ab338e15d23997039b2c95cc5762a (patch)
treee46753e7eaac433e853c4f9cad0591f7a03a6a90 /mysql-test/main/invisible_field.test
parent46be31982a48e0456e9bee9918daf720c07be8b0 (diff)
downloadmariadb-git-9ee5406e2f3ab338e15d23997039b2c95cc5762a.tar.gz
MDEV-15965 Invisible columns and LOAD DATA don't work well together:... ER_WARN_TOO_FEW_RECORDS
Fix mysql_load iterator to skip invisible fields.
Diffstat (limited to 'mysql-test/main/invisible_field.test')
-rw-r--r--mysql-test/main/invisible_field.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/main/invisible_field.test b/mysql-test/main/invisible_field.test
index cfe89d77230..0e3994a78ce 100644
--- a/mysql-test/main/invisible_field.test
+++ b/mysql-test/main/invisible_field.test
@@ -246,3 +246,28 @@ CREATE TRIGGER tr BEFORE INSERT ON t1 FOR EACH ROW SET @a= 1;
INSERT INTO t1 SELECT * FROM t1;
# Cleanup
DROP TABLE t1;
+##LOAD DATA MDEV-15965 Invisible columns and LOAD DATA don't work well
+## together: ER_WARN_TOO_FEW_RECORDS
+create or replace table t1 (a int, b int invisible);
+insert into t1 values (1),(2);
+
+select * from t1 into outfile 'f';
+load data infile 'f' into table t1;
+select a,b from t1;
+load data infile 'f' into table t1 (a,@v) SET b=@v;
+select a,b from t1;
+load data infile 'f' into table t1 (a,@v) SET b=a;
+select a,b from t1;
+truncate table t1;
+
+insert into t1(a,b) values (1,1),(2,2);
+select a,b from t1 into outfile 'a';
+load data infile 'a' into table t1(a,b);
+select a,b from t1;
+load data infile 'a' into table t1 (a,@v) SET b=@v;
+select a,b from t1;
+load data infile 'a' into table t1 (a,@v) SET b=@v+2;
+select a,b from t1;
+
+#cleanup
+drop table t1;