summaryrefslogtreecommitdiff
path: root/storage/spider/mysql-test/spider/regression/e1121/r/item_cache.result
blob: fda178f21e52e629ff08209cada63b466a83256a (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
for master_1
for child2
child2_1
child2_2
child2_3
for child3

this test is for MDEV-16279

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 (
pkey int NOT NULL,
dt datetime NOT NULL,
PRIMARY KEY (pkey),
KEY idx1 (dt)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
INSERT INTO tbl_a (pkey, dt) VALUES (0, '2012-01-01'),(1, '2012-02-01'),(2, '2012-03-01'),(3, '2012-04-01'),(4, '2012-05-01'),(5, '2012-06-01'),(6, '2012-07-01'),(7, '2012-08-01'),(8, '2012-09-01'),(9, '2012-10-01');
INSERT INTO tbl_a (pkey, dt) VALUES (10, '2013-01-01'),(11, '2013-02-01'),(12, '2013-03-01'),(13, '2013-04-01'),(14, '2013-05-01'),(15, '2013-06-01'),(16, '2013-07-01'),(17, '2013-08-01'),(18, '2013-09-01'),(19, '2013-10-01');
INSERT INTO tbl_a (pkey, dt) VALUES (20, '2012-11-01'),(21, '2012-12-01'),(22, '2012-11-30'),(23, '2012-11-29'),(24, '2012-11-28'),(25, '2012-11-27'),(26, '2012-11-26'),(27, '2012-11-25'),(28, '2012-11-24'),(29, '2012-11-23');
FLUSH TABLES;

select test 1
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT pkey, dt FROM tbl_a WHERE dt > SUBDATE('2012-12-31 23:59:59', 31);
pkey	dt
21	2012-12-01 00:00:00
10	2013-01-01 00:00:00
11	2013-02-01 00:00:00
12	2013-03-01 00:00:00
13	2013-04-01 00:00:00
14	2013-05-01 00:00:00
15	2013-06-01 00:00:00
16	2013-07-01 00:00:00
17	2013-08-01 00:00:00
18	2013-09-01 00:00:00
19	2013-10-01 00:00:00
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select t0.`pkey` `pkey`,t0.`dt` `dt` from `auto_test_remote`.`tbl_a` t0 where (t0.`dt` > '2012-11-30 23:59:59')
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey, dt FROM tbl_a ORDER BY pkey;
pkey	dt
0	2012-01-01 00:00:00
1	2012-02-01 00:00:00
2	2012-03-01 00:00:00
3	2012-04-01 00:00:00
4	2012-05-01 00:00:00
5	2012-06-01 00:00:00
6	2012-07-01 00:00:00
7	2012-08-01 00:00:00
8	2012-09-01 00:00:00
9	2012-10-01 00:00:00
10	2013-01-01 00:00:00
11	2013-02-01 00:00:00
12	2013-03-01 00:00:00
13	2013-04-01 00:00:00
14	2013-05-01 00:00:00
15	2013-06-01 00:00:00
16	2013-07-01 00:00:00
17	2013-08-01 00:00:00
18	2013-09-01 00:00:00
19	2013-10-01 00:00:00
20	2012-11-01 00:00:00
21	2012-12-01 00:00:00
22	2012-11-30 00:00:00
23	2012-11-29 00:00:00
24	2012-11-28 00:00:00
25	2012-11-27 00:00:00
26	2012-11-26 00:00:00
27	2012-11-25 00:00:00
28	2012-11-24 00:00:00
29	2012-11-23 00:00:00

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