~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
#
2
# Tests for "LOAD XML" - a contributed patch from Erik Wetterberg.
3
#
4
5
--disable_warnings
6
drop table if exists t1;
7
--enable_warnings
8
9
create table t1 (a int, b varchar(64));
10
11
12
--echo -- Load a static XML file
13
load xml infile '../std_data_ln/loadxml.dat' into table t1
14
rows identified by '<row>';
15
select * from t1 order by a;
16
delete from t1;
17
18
19
--echo -- Load a static XML file with 'IGNORE num ROWS'
20
load xml infile '../std_data_ln/loadxml.dat' into table t1
21
rows identified by '<row>' ignore 4 rows;
22
select * from t1 order by a;
23
24
25
--echo -- Check 'mysqldump --xml' + 'LOAD XML' round trip
26
--exec $MYSQL_DUMP --xml test t1 > "$MYSQLTEST_VARDIR/loadxml-dump.xml" 2>&1
27
delete from t1;
28
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
29
--eval load xml infile '$MYSQLTEST_VARDIR/loadxml-dump.xml' into table t1 rows identified by '<row>';
30
select * from t1 order by a;
31
32
--echo --Check that default row tag is '<row>
33
delete from t1;
34
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
35
--eval load xml infile '$MYSQLTEST_VARDIR/loadxml-dump.xml' into table t1;
36
select * from t1 order by a;
37
38
--echo -- Check that 'xml' is not a keyword
39
select 1 as xml;
40
41
42
#
43
# Clean up
44
#
45
--system rm $MYSQLTEST_VARDIR/loadxml-dump.xml
46
drop table t1;
47