summaryrefslogtreecommitdiff
path: root/storage/spider/mysql-test/spider/handler/r/spider3_fixes.result
blob: 9a8a59153f023e2ad6ffa3de7687168caa3a25ae (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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3
for slave1_1

drop and create databases
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;

test select 1
connection master_1;
SELECT 1;
1
1

3.1
auto_increment
connection master_1;
connection slave1_1;
connection master_1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1
CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1
MASTER_1_AUTO_INCREMENT_INCREMENT2
MASTER_1_AUTO_INCREMENT_OFFSET2
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_1"')
1
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_2"')
1
spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '',
'srv "s_2_1"')
1
spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '',
'srv "s_2_2"')
1
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1
CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1
INSERT INTO t1 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
2
SELECT MAX(id) FROM t1;
MAX(id)
2
INSERT INTO t2 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
6
SELECT MAX(id) FROM t2;
MAX(id)
6
MASTER_1_AUTO_INCREMENT_OFFSET3
INSERT INTO t1 (id) VALUES (null);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
10
SELECT MAX(id) FROM t1;
MAX(id)
10
MASTER_1_AUTO_INCREMENT_OFFSET4
INSERT INTO t2 (id) VALUES (null);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
14
SELECT MAX(id) FROM t2;
MAX(id)
14
MASTER_1_AUTO_INCREMENT_OFFSET3
INSERT INTO t1 () VALUES (),(),(),();
Warnings:
Note	12520	Binlog's auto-inc value is probably different from linked table's auto-inc value
Note	12520	Binlog's auto-inc value is probably different from linked table's auto-inc value
Note	12520	Binlog's auto-inc value is probably different from linked table's auto-inc value
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
18
SELECT id FROM t1 ORDER BY id;
id
2
6
10
14
18
22
26
30
MASTER_1_AUTO_INCREMENT_OFFSET4
INSERT INTO t2 () VALUES (),(),(),();
Warnings:
Note	12520	Binlog's auto-inc value is probably different from linked table's auto-inc value
Note	12520	Binlog's auto-inc value is probably different from linked table's auto-inc value
Note	12520	Binlog's auto-inc value is probably different from linked table's auto-inc value
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
34
SELECT id FROM t2 ORDER BY id;
id
2
6
10
14
18
22
26
30
34
38
42
46
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
INSERT INTO t1 () VALUES (),(),(),();
Warnings:
Note	12520	Binlog's auto-inc value is probably different from linked table's auto-inc value
Note	12520	Binlog's auto-inc value is probably different from linked table's auto-inc value
Note	12520	Binlog's auto-inc value is probably different from linked table's auto-inc value
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
2
SELECT id FROM t1 ORDER BY id;
id
2
6
10
14
INSERT INTO t2 () VALUES (),(),(),();
Warnings:
Note	12520	Binlog's auto-inc value is probably different from linked table's auto-inc value
Note	12520	Binlog's auto-inc value is probably different from linked table's auto-inc value
Note	12520	Binlog's auto-inc value is probably different from linked table's auto-inc value
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
18
SELECT id FROM t2 ORDER BY id;
id
2
6
10
14
18
22
26
30
SET INSERT_ID=5000;
MASTER_1_AUTO_INCREMENT_OFFSET3
INSERT INTO t1 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
34
SELECT MAX(id) FROM t1;
MAX(id)
34
MASTER_1_AUTO_INCREMENT_OFFSET4
INSERT INTO t2 () VALUES ();
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
38
SELECT MAX(id) FROM t2;
MAX(id)
38
INSERT INTO t1 (id) VALUES (10000);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
42
SELECT MAX(id) FROM t1;
MAX(id)
42
INSERT INTO t2 (id) VALUES (1000);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
46
SELECT MAX(id) FROM t2;
MAX(id)
46
connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
2
34
777
1554
2331
10000
connection master_1;

deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for slave1_1
for master_1
for child2
child2_1
child2_2
child2_3
for child3
child3_1
child3_2
child3_3

end of test