diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-05-05 11:05:55 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-05-05 11:05:55 +0400 |
commit | db0917f68f2681882974afd53935aa8cba29c6b8 (patch) | |
tree | 32a9f600b1913a5193e94c09ec442ea2cac14e19 /mysql-test | |
parent | 96247be1a0dfa3035580b53b1c27a7247a410713 (diff) | |
download | mariadb-git-db0917f68f2681882974afd53935aa8cba29c6b8.tar.gz |
MDEV-12696 Crash with LOAD XML and non-updatable VIEW column
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/loadxml.result | 11 | ||||
-rw-r--r-- | mysql-test/std_data/loaddata/mdev12696.xml | 9 | ||||
-rw-r--r-- | mysql-test/t/loadxml.test | 13 |
3 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/r/loadxml.result b/mysql-test/r/loadxml.result index c3b4c867c98..711fea9e854 100644 --- a/mysql-test/r/loadxml.result +++ b/mysql-test/r/loadxml.result @@ -123,3 +123,14 @@ col1 col2 col3 ABC DEF NULL GHI NULL 123 DROP TABLE t1; +# +# MDEV-12696 Crash with LOAD XML and non-updatable VIEW column +# +CREATE TABLE t1 (c1 TEXT); +CREATE VIEW v1 AS SELECT CONCAT(c1,'') AS c1, NULL AS c2 FROM t1; +LOAD XML INFILE '../../std_data/loaddata/mdev12696.xml' INTO TABLE v1 (c1); +ERROR HY000: Invalid column reference (v1.c1) in LOAD DATA +LOAD XML INFILE '../../std_data/loaddata/mdev12696.xml' INTO TABLE v1 (c2); +ERROR HY000: Invalid column reference (v1.c2) in LOAD DATA +DROP VIEW v1; +DROP TABLE t1; diff --git a/mysql-test/std_data/loaddata/mdev12696.xml b/mysql-test/std_data/loaddata/mdev12696.xml new file mode 100644 index 00000000000..a2789acbde5 --- /dev/null +++ b/mysql-test/std_data/loaddata/mdev12696.xml @@ -0,0 +1,9 @@ +<?xml version="1.0"?> + +<resultset statement="SELECT 'test' AS c1, NULL AS c2 +" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <row> + <field name="c1">test</field> + <field name="c2" xsi:nil="true" /> + </row> +</resultset> diff --git a/mysql-test/t/loadxml.test b/mysql-test/t/loadxml.test index 93e6e82189f..b26a2eacc00 100644 --- a/mysql-test/t/loadxml.test +++ b/mysql-test/t/loadxml.test @@ -130,3 +130,16 @@ CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 INTEGER); LOAD XML INFILE '../../std_data/bug16171518_2.dat' INTO TABLE t1; SELECT * FROM t1 ORDER BY col1, col2, col3; DROP TABLE t1; + +--echo # +--echo # MDEV-12696 Crash with LOAD XML and non-updatable VIEW column +--echo # + +CREATE TABLE t1 (c1 TEXT); +CREATE VIEW v1 AS SELECT CONCAT(c1,'') AS c1, NULL AS c2 FROM t1; +--error ER_LOAD_DATA_INVALID_COLUMN +LOAD XML INFILE '../../std_data/loaddata/mdev12696.xml' INTO TABLE v1 (c1); +--error ER_LOAD_DATA_INVALID_COLUMN, +LOAD XML INFILE '../../std_data/loaddata/mdev12696.xml' INTO TABLE v1 (c2); +DROP VIEW v1; +DROP TABLE t1; |