2
# Tests for "LOAD XML" - a contributed patch from Erik Wetterberg.
5
# Running the $MYSQL_DUMP tool against an embedded server does not work.
6
--source include/not_embedded.inc
9
drop table if exists t1;
12
create table t1 (a int, b varchar(64));
15
--echo -- Load a static XML file
16
load xml infile '../std_data_ln/loadxml.dat' into table t1
17
rows identified by '<row>';
18
select * from t1 order by a;
22
--echo -- Load a static XML file with 'IGNORE num ROWS'
23
load xml infile '../std_data_ln/loadxml.dat' into table t1
24
rows identified by '<row>' ignore 4 rows;
25
select * from t1 order by a;
28
--echo -- Check 'mysqldump --xml' + 'LOAD XML' round trip
29
--exec $MYSQL_DUMP --xml test t1 > "$MYSQLTEST_VARDIR/loadxml-dump.xml" 2>&1
31
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
32
--eval load xml infile '$MYSQLTEST_VARDIR/loadxml-dump.xml' into table t1 rows identified by '<row>';
33
select * from t1 order by a;
35
--echo --Check that default row tag is '<row>
37
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
38
--eval load xml infile '$MYSQLTEST_VARDIR/loadxml-dump.xml' into table t1;
39
select * from t1 order by a;
41
--echo -- Check that 'xml' is not a keyword
48
--system rm $MYSQLTEST_VARDIR/loadxml-dump.xml