summaryrefslogtreecommitdiff
path: root/storage/spider/mysql-test/spider/bugfix/r/mdev_20100.result
blob: fc4fb02d72f44bc5eb3f53ac60e0e78b7e0d16d6 (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
for master_1
for child2
child2_1
child2_2
child2_3
for child3

this test is for MDEV-20100

drop and create databases
connection master_1;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote;
USE auto_test_remote;

create table and insert
connection child2_1;
CHILD2_1_CREATE_TABLES
TRUNCATE TABLE mysql.general_log;
connection master_1;
CREATE TABLE tbl_a (
a INT,
b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) ENGINE=Spider PARTITION BY RANGE(a) (
PARTITION pt1 VALUES LESS THAN (5) COMMENT='srv "s_2_1", table "ta_r2"',
PARTITION pt2 VALUES LESS THAN (10) COMMENT='srv "s_2_1", table "ta_r3"',
PARTITION pt3 VALUES LESS THAN MAXVALUE COMMENT='srv "s_2_1", table "ta_r4"'
  )
INSERT INTO tbl_a (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');

test 1
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a, b, c FROM tbl_a PARTITION (pt2) WHERE b = 'c';
a	b	c
5	c	2001-12-31 23:59:59
SELECT a, b, c FROM tbl_a PARTITION (pt1,pt2);
a	b	c
1	a	2008-08-01 10:21:39
2	b	2000-01-01 00:00:00
3	e	2007-06-04 20:03:11
4	d	2003-11-30 05:01:03
5	c	2001-12-31 23:59:59
SELECT a, b, c FROM tbl_a PARTITION (pt3) WHERE b = 'c';
a	b	c
SELECT a, b, c FROM tbl_a PARTITION (pt1,pt2);
a	b	c
1	a	2008-08-01 10:21:39
2	b	2000-01-01 00:00:00
3	e	2007-06-04 20:03:11
4	d	2003-11-30 05:01:03
5	c	2001-12-31 23:59:59
SELECT a, b, c FROM tbl_a PARTITION (pt1) WHERE b = 'c';
a	b	c
SELECT a, b, c FROM tbl_a PARTITION (pt1,pt3);
a	b	c
1	a	2008-08-01 10:21:39
2	b	2000-01-01 00:00:00
3	e	2007-06-04 20:03:11
4	d	2003-11-30 05:01:03
SELECT a, b, c FROM tbl_a PARTITION (pt1) WHERE b = 'c';
a	b	c
SELECT a, b, c FROM tbl_a PARTITION (pt2,pt3);
a	b	c
5	c	2001-12-31 23:59:59
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `a`,`b`,`c` from `auto_test_remote`.`ta_r3` where (`b` = 'c')
select `a`,`b`,`c` from `auto_test_remote`.`ta_r2`
select `a`,`b`,`c` from `auto_test_remote`.`ta_r3`
select `a`,`b`,`c` from `auto_test_remote`.`ta_r4` where (`b` = 'c')
select `a`,`b`,`c` from `auto_test_remote`.`ta_r2`
select `a`,`b`,`c` from `auto_test_remote`.`ta_r3`
select `a`,`b`,`c` from `auto_test_remote`.`ta_r2` where (`b` = 'c')
select `a`,`b`,`c` from `auto_test_remote`.`ta_r2`
select `a`,`b`,`c` from `auto_test_remote`.`ta_r4`
select `a`,`b`,`c` from `auto_test_remote`.`ta_r2` where (`b` = 'c')
select `a`,`b`,`c` from `auto_test_remote`.`ta_r3`
select `a`,`b`,`c` from `auto_test_remote`.`ta_r4`
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT a, b, c FROM ta_r2 ORDER BY a ;
SELECT a, b, c FROM ta_r3 ORDER BY a ;
SELECT a, b, c FROM ta_r4 ORDER BY a;
a	b	c
1	a	2008-08-01 10:21:39
2	b	2000-01-01 00:00:00
3	e	2007-06-04 20:03:11
4	d	2003-11-30 05:01:03
a	b	c
5	c	2001-12-31 23:59:59
a	b	c

deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
for master_1
for child2
child2_1
child2_2
child2_3
for child3

end of test