1
by brian
clean slate |
1 |
drop table if exists t1; |
2 |
create table t1 (a int, b varchar(64)); |
|
3 |
-- Load a static XML file |
|
4 |
load xml infile '../std_data_ln/loadxml.dat' into table t1 |
|
5 |
rows identified by '<row>'; |
|
6 |
select * from t1 order by a; |
|
7 |
a b |
|
8 |
1 b1 |
|
9 |
2 b2 |
|
10 |
3 b3 |
|
11 |
11 b11 |
|
12 |
111 b111 |
|
13 |
112 b112 & < > " ' &unknown; -- check entities |
|
14 |
212 b212 |
|
15 |
213 b213 |
|
16 |
214 b214 |
|
17 |
215 b215 |
|
18 |
216 &bb b; |
|
19 |
delete from t1; |
|
20 |
-- Load a static XML file with 'IGNORE num ROWS' |
|
21 |
load xml infile '../std_data_ln/loadxml.dat' into table t1 |
|
22 |
rows identified by '<row>' ignore 4 rows; |
|
23 |
select * from t1 order by a; |
|
24 |
a b |
|
25 |
111 b111 |
|
26 |
112 b112 & < > " ' &unknown; -- check entities |
|
27 |
212 b212 |
|
28 |
213 b213 |
|
29 |
214 b214 |
|
30 |
215 b215 |
|
31 |
216 &bb b; |
|
32 |
-- Check 'mysqldump --xml' + 'LOAD XML' round trip |
|
33 |
delete from t1; |
|
34 |
load xml infile 'MYSQLTEST_VARDIR/loadxml-dump.xml' into table t1 rows identified by '<row>';; |
|
35 |
select * from t1 order by a; |
|
36 |
a b |
|
37 |
111 b111 |
|
38 |
112 b112 & < > " ' &unknown; -- check entities |
|
39 |
212 b212 |
|
40 |
213 b213 |
|
41 |
214 b214 |
|
42 |
215 b215 |
|
43 |
216 &bb b; |
|
44 |
--Check that default row tag is '<row> |
|
45 |
delete from t1; |
|
46 |
load xml infile 'MYSQLTEST_VARDIR/loadxml-dump.xml' into table t1;; |
|
47 |
select * from t1 order by a; |
|
48 |
a b |
|
49 |
111 b111 |
|
50 |
112 b112 & < > " ' &unknown; -- check entities |
|
51 |
212 b212 |
|
52 |
213 b213 |
|
53 |
214 b214 |
|
54 |
215 b215 |
|
55 |
216 &bb b; |
|
56 |
-- Check that 'xml' is not a keyword |
|
57 |
select 1 as xml; |
|
58 |
xml
|
|
59 |
1
|
|
60 |
drop table t1; |