diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2019-01-30 19:35:40 +0530 |
---|---|---|
committer | Varun Gupta <varun.gupta@mariadb.com> | 2019-01-30 19:35:40 +0530 |
commit | 6092093cb99a71b0aec02b785087c0df307b1a66 (patch) | |
tree | 9fff4e5b579dbcc634cf9abfa82414ff9c0e01f2 /mysql-test/t | |
parent | 08c05b5f34f7b301ba669a88df3b038f0c34d379 (diff) | |
download | mariadb-git-6092093cb99a71b0aec02b785087c0df307b1a66.tar.gz |
MDEV-15950: LOAD DATA INTO compex_view crashed
For multi-table views with LOAD, updates are not allowed, so
we should just throw an error.
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/loaddata.test | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 50d5615e58c..de9de4305a3 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -690,3 +690,34 @@ select * from v2; select * from t2; DROP VIEW IF EXISTS v2,t2; DROP TABLE IF EXISTS t1; + +--echo # +--echo # MDEV-15950: LOAD DATA INTO compex_view crashed +--echo # +create table t1 (a int, b int); +create table t0 (x int, y int); +CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1,t0; +CREATE VIEW v2 AS SELECT * FROM v1; + +--error ER_WRONG_USAGE +LOAD DATA INFILE '../../std_data/loaddata7.dat' INTO TABLE v1 +FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'; + +--error ER_WRONG_USAGE +LOAD DATA INFILE '../../std_data/loaddata7.dat' INTO TABLE v2 +FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'; + +DROP VIEW IF EXISTS v2,v1; +DROP TABLE IF EXISTS t1,t0; + +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), UNIQUE(b)); +INSERT INTO t1 VALUES (1,1); +CREATE TABLE t2 (c INT); +CREATE VIEW v AS SELECT t1.* FROM t1 JOIN t2; +SELECT a, b FROM t1 INTO OUTFILE '15645.data'; +--error ER_WRONG_USAGE +LOAD DATA INFILE '15645.data' IGNORE INTO TABLE v (a,b); +--error ER_WRONG_USAGE +LOAD DATA INFILE '15645.data' REPLACE INTO TABLE v (a,b); +drop table t1,t2; +drop view v; |