summaryrefslogtreecommitdiff
path: root/storage/connect/mysql-test/connect/r/xml_mult.result
blob: c786a80819c8080d4c41aa07e06bae9dc9877762 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
SET NAMES utf8;
#
# Testing expanded values
#
CREATE TABLE `bookstore` (
`category` CHAR(16) NOT NULL FIELD_FORMAT='@',
`title` VARCHAR(50) NOT NULL,
`lang` char(2) NOT NULL FIELD_FORMAT='title/@',
`author` VARCHAR(24) NOT NULL,
`year` INT(4) NOT NULL,
`price` DOUBLE(8,2) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='bookstore.xml' OPTION_LIST='expand=1,mulnode=author,limit=6,xmlsup=domdoc';
SELECT * FROM bookstore;
category	title	lang	author	year	price
COOKING	Everyday Italian	en	Giada De Laurentiis	2005	30.00
CHILDREN	Harry Potter	en	J K. Rowling	2005	29.99
WEB	XQuery Kick Start	en	James McGovern	2003	49.99
WEB	XQuery Kick Start	en	Per Bothner	2003	49.99
WEB	XQuery Kick Start	en	Kurt Cagle	2003	49.99
WEB	XQuery Kick Start	en	James Linn	2003	49.99
WEB	XQuery Kick Start	en	Vaidyanathan Nagarajan	2003	49.99
WEB	Learning XML	en	Erik T. Ray	2003	39.95
SELECT category, title, price FROM bookstore;
category	title	price
COOKING	Everyday Italian	30.00
CHILDREN	Harry Potter	29.99
WEB	XQuery Kick Start	49.99
WEB	Learning XML	39.95
SELECT category, title, author, price FROM bookstore WHERE author LIKE '%K%';
category	title	author	price
CHILDREN	Harry Potter	J K. Rowling	29.99
WEB	XQuery Kick Start	Kurt Cagle	49.99
WEB	Learning XML	Erik T. Ray	39.95
SELECT category, title, price FROM bookstore WHERE author LIKE 'J%';
category	title	price
CHILDREN	Harry Potter	29.99
WEB	XQuery Kick Start	49.99
WEB	XQuery Kick Start	49.99
#
# Limiting expanded values
#
ALTER TABLE bookstore OPTION_LIST='expand=1,mulnode=author,limit=3,xmlsup=domdoc';
SELECT * FROM bookstore;
category	title	lang	author	year	price
COOKING	Everyday Italian	en	Giada De Laurentiis	2005	30.00
CHILDREN	Harry Potter	en	J K. Rowling	2005	29.99
WEB	XQuery Kick Start	en	James McGovern	2003	49.99
WEB	XQuery Kick Start	en	Per Bothner	2003	49.99
WEB	XQuery Kick Start	en	Kurt Cagle	2003	49.99
WEB	Learning XML	en	Erik T. Ray	2003	39.95
Warnings:
Warning	1105	Multiple values limited to 3
# One line lost because the where clause is applied only on the first 3 rows
SELECT category, title, author, price FROM bookstore WHERE author LIKE 'J%';
category	title	author	price
CHILDREN	Harry Potter	J K. Rowling	29.99
WEB	XQuery Kick Start	James McGovern	49.99
Warnings:
Warning	1105	Multiple values limited to 3
#
# Testing concatenated values
#
ALTER TABLE bookstore OPTION_LIST='mulnode=author,limit=6,xmlsup=domdoc';
# truncated
SELECT * FROM bookstore;
category	title	lang	author	year	price
COOKING	Everyday Italian	en	Giada De Laurentiis	2005	30.00
CHILDREN	Harry Potter	en	J K. Rowling	2005	29.99
WEB	XQuery Kick Start	en	James McGovern, Per Both	2003	49.99
WEB	Learning XML	en	Erik T. Ray	2003	39.95
Warnings:
Warning	1105	Truncated author content
# increase author size
ALTER TABLE bookstore MODIFY `author` VARCHAR(128) NOT NULL;
Warnings:
Warning	1105	This is an outward table, table data were not modified.
SELECT * FROM bookstore;
category	title	lang	author	year	price
COOKING	Everyday Italian	en	Giada De Laurentiis	2005	30.00
CHILDREN	Harry Potter	en	J K. Rowling	2005	29.99
WEB	XQuery Kick Start	en	James McGovern, Per Bothner, Kurt Cagle, James Linn, Vaidyanathan Nagarajan	2003	49.99
WEB	Learning XML	en	Erik T. Ray	2003	39.95
#
# Limiting concatenated values
#
ALTER TABLE bookstore OPTION_LIST='mulnode=author,limit=4,xmlsup=domdoc';
SELECT * FROM bookstore;
category	title	lang	author	year	price
COOKING	Everyday Italian	en	Giada De Laurentiis	2005	30.00
CHILDREN	Harry Potter	en	J K. Rowling	2005	29.99
WEB	XQuery Kick Start	en	James McGovern, Per Bothner, Kurt Cagle, James Linn	2003	49.99
WEB	Learning XML	en	Erik T. Ray	2003	39.95
Warnings:
Warning	1105	Multiple values limited to 4
# The where clause is applied on the concatenated column result
SELECT category, title, author, price FROM bookstore WHERE author LIKE 'J%';
category	title	author	price
CHILDREN	Harry Potter	J K. Rowling	29.99
WEB	XQuery Kick Start	James McGovern, Per Bothner, Kurt Cagle, James Linn	49.99
Warnings:
Warning	1105	Multiple values limited to 4
DROP TABLE bookstore;