Debian Codegraph @

mysql-test/suite/federated/t/federated.test

raw
1 # Note: This test is tricky. It reuses the prerequisites generated for
2 # replication tests (master+slave server and connections) for its
3 # own purposes. But the replication feature itself is stopped.
4 #
5
6 --source include/no_valgrind_without_big.inc
7 --source suite/federated/include/federated.inc
8 connection default;
9 # Disable concurrent inserts to avoid test failures when reading
10 # data from concurrent connections (insert might return before
11 # the data is actually in the table).
12 SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
13 SET @@GLOBAL.CONCURRENT_INSERT= 0;
14
15 connection slave;
16 SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
17 SET @@GLOBAL.CONCURRENT_INSERT= 0;
18 DROP TABLE IF EXISTS federated.t1;
19 CREATE TABLE federated.t1 (
20 `id` int(20) NOT NULL,
21 `group` int NOT NULL default 0,
22 `a\\b` int NOT NULL default 0,
23 `a\\` int NOT NULL default 0,
24 `name` varchar(32) NOT NULL default ''
25 )
26 DEFAULT CHARSET=latin1;
27
28 connection master;
29 DROP TABLE IF EXISTS federated.t1;
30 # test too many items (malformed) in the comment string url
31 --error ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE
32 CREATE TABLE federated.t1 (
33 `id` int(20) NOT NULL,
34 `group` int NOT NULL default 0,
35 `a\\b` inT NOT NULL default 0,
36 `a\\` int NOT NULL default 0,
37 `name` varchar(32) NOT NULL default ''
38 )
39 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
40 CONNECTION='mysql://[email protected]:@/too/many/items/federated/t1';
41
42 # test not enough items (malformed) in the comment string url
43 --error ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE
44 CREATE TABLE federated.t1 (
45 `id` int(20) NOT NULL,
46 `group` int NOT NULL default 0,
47 `a\\b` iNt NOT NULL default 0,
48 `a\\` int NOT NULL default 0,
49 `name` varchar(32) NOT NULL default ''
50 )
51 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
52 CONNECTION='mysql://[email protected]';
53
54 # test non-existant table
55 --replace_result $SLAVE_MYPORT SLAVE_PORT
56 eval CREATE TABLE federated.t1 (
57 `id` int(20) NOT NULL,
58 `group` int NOT NULL default 0,
59 `a\\\\b` iNT NOT NULL default 0,
60 `a\\\\` int NOT NULL default 0,
61 `name` varchar(32) NOT NULL default ''
62 )
63 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
64 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t3';
65 --error ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST
66 SELECT * FROM federated.t1;
67 DROP TABLE federated.t1;
68
69 # test bad user/password
70 --replace_result $SLAVE_MYPORT SLAVE_PORT
71 eval CREATE TABLE federated.t1 (
72 `id` int(20) NOT NULL,
73 `group` int NOT NULL default 0,
74 `a\\\\b` Int NOT NULL default 0,
75 `a\\\\` int NOT NULL default 0,
76 `name` varchar(32) NOT NULL default ''
77 )
78 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
79 CONNECTION='mysql://user:[email protected]:$SLAVE_MYPORT/federated/t1';
80 --error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
81 SELECT * FROM federated.t1;
82 DROP TABLE federated.t1;
83
84 # # correct connection, same named tables
85 --replace_result $SLAVE_MYPORT SLAVE_PORT
86 eval CREATE TABLE federated.t1 (
87 `id` int(20) NOT NULL,
88 `group` int NOT NULL default 0,
89 `a\\\\b` InT NOT NULL default 0,
90 `a\\\\` int NOT NULL default 0,
91 `name` varchar(32) NOT NULL default ''
92 )
93 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
94 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
95
96 INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
97 INSERT INTO federated.t1 (id, name) VALUES (2, 'fee');
98 INSERT INTO federated.t1 (id, `group`) VALUES (3, 42);
99 INSERT INTO federated.t1 (id, `a\\b`) VALUES (4, 23);
100 INSERT INTO federated.t1 (id, `a\\`) VALUES (5, 1);
101
102 --sorted_result
103 SELECT * FROM federated.t1;
104 DELETE FROM federated.t1;
105 DROP TABLE federated.t1;
106
107 # correct connection, differently named tables
108 DROP TABLE IF EXISTS federated.t2;
109 --replace_result $SLAVE_MYPORT SLAVE_PORT
110 eval CREATE TABLE federated.t2 (
111 `id` int(20) NOT NULL,
112 `name` varchar(32) NOT NULL default ''
113 )
114 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
115 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
116
117 --replace_result $SLAVE_MYPORT SLAVE_PORT
118 eval SHOW CREATE TABLE federated.t2;
119
120 INSERT INTO federated.t2 (id, name) VALUES (1, 'foo');
121 INSERT INTO federated.t2 (id, name) VALUES (2, 'fee');
122
123 SELECT * FROM federated.t2 ORDER BY id, name;
124 DROP TABLE federated.t2;
125
126 connection slave;
127 DROP TABLE IF EXISTS federated.t1;
128
129 DROP TABLE IF EXISTS federated.`t1%`;
130 CREATE TABLE federated.`t1%` (
131 `id` int(20) NOT NULL,
132 `name` varchar(32) NOT NULL default ''
133 )
134 DEFAULT CHARSET=latin1;
135
136 connection master;
137 DROP TABLE IF EXISTS federated.t1;
138
139 --replace_result $SLAVE_MYPORT SLAVE_PORT
140 eval CREATE TABLE federated.t1 (
141 `id` int(20) NOT NULL,
142 `name` varchar(32) NOT NULL default ''
143 )
144 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
145 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1%';
146
147 INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
148 INSERT INTO federated.t1 (id, name) VALUES (2, 'fee');
149
150 SELECT * FROM federated.t1 ORDER BY id,name;
151 DELETE FROM federated.t1;
152 DROP TABLE IF EXISTS federated.t1;
153
154 --replace_result $SLAVE_MYPORT SLAVE_PORT
155 eval CREATE TABLE federated.`t1%` (
156 `id` int(20) NOT NULL,
157 `name` varchar(32) NOT NULL default ''
158 )
159 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
160 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1%';
161
162 INSERT INTO federated.`t1%` (id, name) VALUES (1, 'foo');
163 INSERT INTO federated.`t1%` (id, name) VALUES (2, 'fee');
164
165 SELECT * FROM federated.`t1%` ORDER BY id, name;
166 DELETE FROM federated.`t1%`;
167 DROP TABLE IF EXISTS federated.`t1%`;
168
169 connection slave;
170 DROP TABLE IF EXISTS federated.`t1%`;
171
172 # I wanted to use timestamp, but results will fail if so!!!
173 DROP TABLE IF EXISTS federated.t1;
174 CREATE TABLE federated.t1 (
175 `id` int(20) NOT NULL auto_increment,
176 `name` varchar(32) NOT NULL default '',
177 `other` int(20) NOT NULL default '0',
178 `created` datetime default '2004-04-04 04:04:04',
179 PRIMARY KEY (`id`))
180 DEFAULT CHARSET=latin1;
181
182 connection master;
183 --replace_result $SLAVE_MYPORT SLAVE_PORT
184 eval CREATE TABLE federated.t1 (
185 `id` int(20) NOT NULL auto_increment,
186 `name` varchar(32) NOT NULL default '',
187 `other` int(20) NOT NULL default '0',
188 `created` datetime default '2004-04-04 04:04:04',
189 PRIMARY KEY (`id`))
190 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
191 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
192
193 INSERT INTO federated.t1 (name, other) VALUES ('First Name', 11111);
194 INSERT INTO federated.t1 (name, other) VALUES ('Second Name', 22222);
195 INSERT INTO federated.t1 (name, other) VALUES ('Third Name', 33333);
196 INSERT INTO federated.t1 (name, other) VALUES ('Fourth Name', 44444);
197 INSERT INTO federated.t1 (name, other) VALUES ('Fifth Name', 55555);
198 INSERT INTO federated.t1 (name, other) VALUES ('Sixth Name', 66666);
199 INSERT INTO federated.t1 (name, other) VALUES ('Seventh Name', 77777);
200 INSERT INTO federated.t1 (name, other) VALUES ('Eigth Name', 88888);
201 INSERT INTO federated.t1 (name, other) VALUES ('Ninth Name', 99999);
202 INSERT INTO federated.t1 (name, other) VALUES ('Tenth Name', 101010);
203
204 # basic select
205 --sorted_result
206 SELECT * FROM federated.t1;
207 # with PRIMARY KEY index_read_idx
208 SELECT * FROM federated.t1 WHERE id = 5;
209 SELECT * FROM federated.t1 WHERE name = 'Sixth Name';
210 SELECT * FROM federated.t1 WHERE id = 6 and name = 'Sixth Name';
211 SELECT * FROM federated.t1 WHERE name = 'Sixth Name' AND other = 44444;
212 --sorted_result
213 SELECT * FROM federated.t1 WHERE name like '%th%';
214 UPDATE federated.t1 SET name = '3rd name' WHERE id = 3;
215 SELECT * FROM federated.t1 WHERE name = '3rd name';
216 UPDATE federated.t1 SET name = 'Third name' WHERE name = '3rd name';
217 SELECT * FROM federated.t1 WHERE name = 'Third name';
218 # rnd_post, ::position
219 SELECT * FROM federated.t1 ORDER BY id DESC;
220 SELECT * FROM federated.t1 ORDER BY name;
221 SELECT * FROM federated.t1 ORDER BY name DESC;
222 SELECT * FROM federated.t1 ORDER BY name ASC;
223 --source include/turn_off_only_full_group_by.inc
224 SELECT * FROM federated.t1 GROUP BY other;
225 --source include/restore_sql_mode_after_turn_off_only_full_group_by.inc
226
227 # ::delete_row
228 DELETE FROM federated.t1 WHERE id = 5;
229 SELECT * FROM federated.t1 WHERE id = 5;
230
231 # ::delete_all_rows
232 DELETE FROM federated.t1;
233 SELECT * FROM federated.t1 WHERE id = 5;
234
235 # previous test, but this time with indexes
236 connection slave;
237 DROP TABLE IF EXISTS federated.t1;
238 CREATE TABLE federated.t1 (
239 `id` int(20) NOT NULL auto_increment,
240 `name` varchar(32) NOT NULL default '',
241 `other` int(20) NOT NULL default '0',
242 `created` datetime NOT NULL,
243 PRIMARY KEY (`id`),
244 key name(`name`),
245 key other(`other`),
246 key created(`created`))
247 DEFAULT CHARSET=latin1;
248
249 connection master;
250 DROP TABLE IF EXISTS federated.t1;
251 --replace_result $SLAVE_MYPORT SLAVE_PORT
252 eval CREATE TABLE federated.t1 (
253 `id` int(20) NOT NULL auto_increment,
254 `name` varchar(32) NOT NULL default '',
255 `other` int(20) NOT NULL default '0',
256 `created` datetime NOT NULL,
257 PRIMARY KEY (`id`),
258 key name(`name`),
259 key other(`other`),
260 key created(`created`))
261 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
262 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
263
264 INSERT INTO federated.t1 (name, other, created)
265 VALUES ('First Name', 11111, '2004-01-01 01:01:01');
266 INSERT INTO federated.t1 (name, other, created)
267 VALUES ('Second Name', 22222, '2004-01-23 02:43:00');
268 INSERT INTO federated.t1 (name, other, created)
269 VALUES ('Third Name', 33333, '2004-02-14 02:14:00');
270 INSERT INTO federated.t1 (name, other, created)
271 VALUES ('Fourth Name', 44444, '2003-04-05 00:00:00');
272 INSERT INTO federated.t1 (name, other, created)
273 VALUES ('Fifth Name', 55555, '2001-02-02 02:02:02');
274 INSERT INTO federated.t1 (name, other, created)
275 VALUES ('Sixth Name', 66666, '2005-06-06 15:30:00');
276 INSERT INTO federated.t1 (name, other, created)
277 VALUES ('Seventh Name', 77777, '2003-12-12 18:32:00');
278 INSERT INTO federated.t1 (name, other, created)
279 VALUES ('Eigth Name', 88888, '2005-03-12 11:00:00');
280 INSERT INTO federated.t1 (name, other, created)
281 VALUES ('Ninth Name', 99999, '2005-03-12 11:00:01');
282 INSERT INTO federated.t1 (name, other, created)
283 VALUES ('Tenth Name', 101010, '2005-03-12 12:00:01');
284
285 # basic select
286 --sorted_result
287 SELECT * FROM federated.t1;
288 # with PRIMARY KEY index_read_idx
289 SELECT * FROM federated.t1 WHERE id = 5;
290 # with regular key index_read -> index_read_idx
291 # regular and PRIMARY KEY index_read_idx
292 SELECT * FROM federated.t1 WHERE id = 6 and name = 'Sixth Name';
293 # with regular key index_read -> index_read_idx
294 SELECT * FROM federated.t1 WHERE other = 44444;
295 --sorted_result
296 SELECT * FROM federated.t1 WHERE name like '%th%';
297 # update - update_row, index_read_idx
298 UPDATE federated.t1 SET name = '3rd name' WHERE id = 3;
299 SELECT * FROM federated.t1 WHERE name = '3rd name';
300 # update - update_row, index_read -> index_read_idx
301 UPDATE federated.t1 SET name = 'Third name' WHERE name = '3rd name';
302 SELECT * FROM federated.t1 WHERE name = 'Third name';
303 # rnd_post, ::position
304 SELECT * FROM federated.t1 ORDER BY id DESC;
305 SELECT * FROM federated.t1 ORDER BY name;
306 SELECT * FROM federated.t1 ORDER BY name DESC;
307 SELECT * FROM federated.t1 ORDER BY name ASC;
308 --source include/turn_off_only_full_group_by.inc
309 SELECT * FROM federated.t1 GROUP BY other;
310 --source include/restore_sql_mode_after_turn_off_only_full_group_by.inc
311
312 # ::delete_row
313 DELETE FROM federated.t1 WHERE id = 5;
314 SELECT * FROM federated.t1 WHERE id = 5;
315
316 # ::delete_all_rows
317 DELETE FROM federated.t1;
318 SELECT * FROM federated.t1 WHERE id = 5;
319 connection slave;
320 DROP TABLE IF EXISTS federated.t1;
321 CREATE TABLE federated.t1 (
322 `id` int(20) NOT NULL auto_increment,
323 `name` varchar(32),
324 `other` varchar(20),
325 PRIMARY KEY (`id`) );
326
327 connection master;
328 DROP TABLE IF EXISTS federated.t1;
329 --replace_result $SLAVE_MYPORT SLAVE_PORT
330 eval CREATE TABLE federated.t1 (
331 `id` int(20) NOT NULL auto_increment,
332 `name` varchar(32),
333 `other` varchar(20),
334 PRIMARY KEY (`id`) )
335 ENGINE="FEDERATED"
336 DEFAULT CHARSET=latin1
337 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
338
339 INSERT INTO federated.t1 (name, other) VALUES ('First Name', 11111);
340 INSERT INTO federated.t1 (name, other) VALUES ('Second Name', NULL);
341 INSERT INTO federated.t1 (name, other) VALUES ('Third Name', 33333);
342 INSERT INTO federated.t1 (name, other) VALUES (NULL, NULL);
343 INSERT INTO federated.t1 (name, other) VALUES ('Fifth Name', 55555);
344 INSERT INTO federated.t1 (name, other) VALUES ('Sixth Name', 66666);
345 INSERT INTO federated.t1 (name) VALUES ('Seventh Name');
346 INSERT INTO federated.t1 (name, other) VALUES ('Eigth Name', 88888);
347 INSERT INTO federated.t1 (name, other) VALUES ('Ninth Name', 99999);
348 INSERT INTO federated.t1 (other) VALUES ('fee fie foe fum');
349
350 --sorted_result
351 SELECT * FROM federated.t1 WHERE other IS NULL;
352 --sorted_result
353 SELECT * FROM federated.t1 WHERE name IS NULL;
354 SELECT * FROM federated.t1 WHERE name IS NULL and other IS NULL;
355 --sorted_result
356 SELECT * FROM federated.t1 WHERE name IS NULL or other IS NULL;
357
358 UPDATE federated.t1
359 SET name = 'Fourth Name', other = 'four four four'
360 WHERE name IS NULL AND other IS NULL;
361
362 UPDATE federated.t1 SET other = 'two two two two' WHERE name = 'Second Name';
363 UPDATE federated.t1 SET other = 'seven seven' WHERE name like 'Sev%';
364 UPDATE federated.t1 SET name = 'Tenth Name' WHERE other like 'fee fie%';
365 SELECT * FROM federated.t1 WHERE name IS NULL OR other IS NULL ;
366 --sorted_result
367 SELECT * FROM federated.t1;
368
369 # test multi-keys
370 connection slave;
371 DROP TABLE IF EXISTS federated.t1;
372 CREATE TABLE federated.t1 (
373 `id` int(20) NOT NULL auto_increment,
374 `name` varchar(32) NOT NULL DEFAULT '',
375 `other` varchar(20) NOT NULL DEFAULT '',
376 PRIMARY KEY (`id`),
377 KEY nameoth (name, other) );
378
379 connection master;
380 DROP TABLE IF EXISTS federated.t1;
381 --replace_result $SLAVE_MYPORT SLAVE_PORT
382 eval CREATE TABLE federated.t1 (
383 `id` int(20) NOT NULL auto_increment,
384 `name` varchar(32) NOT NULL DEFAULT '',
385 `other` varchar(20) NOT NULL DEFAULT '',
386 PRIMARY KEY (`id`),
387 KEY nameoth (name, other))
388 ENGINE="FEDERATED" DEFAULT
389 CHARSET=latin1
390 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
391
392 INSERT INTO federated.t1 (name, other) VALUES ('First Name', '1111');
393 INSERT INTO federated.t1 (name, other) VALUES ('Second Name', '2222');
394 INSERT INTO federated.t1 (name, other) VALUES ('Third Name', '3333');
395 SELECT * FROM federated.t1 WHERE name = 'Second Name';
396 SELECT * FROM federated.t1 WHERE other = '2222';
397 SELECT * FROM federated.t1 WHERE name = 'Third Name';
398 SELECT * FROM federated.t1 WHERE name = 'Third Name' AND other = '3333';
399
400 connection slave;
401 DROP TABLE IF EXISTS federated.t1;
402 CREATE TABLE federated.t1 (
403 `id` int NOT NULL auto_increment,
404 `name` char(32) NOT NULL DEFAULT '',
405 `bincol` binary(1) NOT NULL,
406 `floatval` decimal(5,2) NOT NULL DEFAULT 0.0,
407 `other` int NOT NULL DEFAULT 0,
408 PRIMARY KEY (id),
409 KEY nameoth(name, other),
410 KEY bincol(bincol),
411 KEY floatval(floatval));
412
413 # test other types of indexes
414 connection master;
415 DROP TABLE IF EXISTS federated.t1;
416 --replace_result $SLAVE_MYPORT SLAVE_PORT
417 eval CREATE TABLE federated.t1 (
418 `id` int NOT NULL auto_increment,
419 `name` char(32) NOT NULL DEFAULT '',
420 `bincol` binary(1) NOT NULL,
421 `floatval` decimal(5,2) NOT NULL DEFAULT 0.0,
422 `other` int NOT NULL DEFAULT 0,
423 PRIMARY KEY (id),
424 KEY nameoth(name,other),
425 KEY bincol(bincol),
426 KEY floatval(floatval))
427 ENGINE="FEDERATED"
428 DEFAULT CHARSET=latin1
429 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
430
431 INSERT INTO federated.t1 (name, bincol, floatval, other)
432 VALUES ('first', 0x65, 11.11, 1111);
433 INSERT INTO federated.t1 (name, bincol, floatval, other)
434 VALUES ('second', 0x66, 22.22, 2222);
435 INSERT INTO federated.t1 (name, bincol, floatval, other)
436 VALUES ('third', 'g', 22.22, 2222);
437 --sorted_result
438 SELECT * FROM federated.t1;
439 SELECT * FROM federated.t1 WHERE name = 'second';
440 SELECT * FROM federated.t1 WHERE bincol= 'f';
441 SELECT * FROM federated.t1 WHERE bincol= 0x66;
442 SELECT * FROM federated.t1 WHERE bincol= 0x67;
443 SELECT * FROM federated.t1 WHERE bincol= 'g';
444 SELECT * FROM federated.t1 WHERE floatval=11.11;
445 SELECT * FROM federated.t1 WHERE name='third';
446 --sorted_result
447 SELECT * FROM federated.t1 WHERE other=2222;
448 SELECT * FROM federated.t1 WHERE name='third' and other=2222;
449
450 # more multi-column indexes, in the primary key
451 connection slave;
452 DROP TABLE IF EXISTS federated.t1;
453 CREATE TABLE federated.t1 (
454 `id` int NOT NULL auto_increment,
455 `col1` int(10) NOT NULL DEFAULT 0,
456 `col2` varchar(64) NOT NULL DEFAULT '',
457 `col3` int(20) NOT NULL,
458 `col4` int(40) NOT NULL,
459 primary key (`id`, `col1`, `col2`, `col3`, `col4`),
460 key col1(col1),
461 key col2(col2),
462 key col3(col3),
463 key col4(col4));
464
465 connection master;
466 DROP TABLE IF EXISTS federated.t1;
467 --replace_result $SLAVE_MYPORT SLAVE_PORT
468 eval CREATE TABLE federated.t1 (
469 `id` int NOT NULL auto_increment,
470 `col1` int(10) NOT NULL DEFAULT 0,
471 `col2` varchar(64) NOT NULL DEFAULT '',
472 `col3` int(20) NOT NULL,
473 `col4` int(40) NOT NULL,
474 primary key (`id`, `col1`, `col2`, `col3`, `col4`),
475 key col1(col1),
476 key col2(col2),
477 key col3(col3),
478 key col4(col4))
479 ENGINE="FEDERATED"
480 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
481
482 INSERT INTO federated.t1 (col1, col2, col3, col4)
483 VALUES (1, 'one One', 11, 1111);
484 INSERT INTO federated.t1 (col1, col2, col3, col4)
485 VALUES (2, 'Two two', 22, 2222);
486 INSERT INTO federated.t1 (col1, col2, col3, col4)
487 VALUES (3, 'three Three', 33, 33333);
488 INSERT INTO federated.t1 (col1, col2, col3, col4)
489 VALUES (4, 'fourfourfour', 444, 4444444);
490 INSERT INTO federated.t1 (col1, col2, col3, col4)
491 VALUES (5, 'five 5 five five 5', 5, 55555);
492 INSERT INTO federated.t1 (col1, col2, col3, col4)
493 VALUES (6, 'six six Sixsix', 6666, 6);
494 INSERT INTO federated.t1 (col1, col2, col3, col4)
495 VALUES (7, 'seven Sevenseven', 77777, 7777);
496 INSERT INTO federated.t1 (col1, col2, col3, col4)
497 VALUES (8, 'eight eight eight', 88888, 88);
498 INSERT INTO federated.t1 (col1, col2, col3, col4)
499 VALUES (9, 'nine Nine', 999999, 999999);
500 INSERT INTO federated.t1 (col1, col2, col3, col4)
501 VALUES (10, 'Tenth ten TEN', 1010101, 1010);
502
503 SELECT * FROM federated.t1 WHERE col2 = 'two two';
504 SELECT * FROM federated.t1 WHERE col2 = 'two Two';
505 SELECT * FROM federated.t1 WHERE id = 3;
506 SELECT * FROM federated.t1 WHERE id = 3 AND col1 = 3;
507 SELECT * FROM federated.t1 WHERE id = 4 AND col1 = 4 AND col2 = 'Two two';
508 SELECT * FROM federated.t1 WHERE id = 4 AND col1 = 4 AND col2 = 'fourfourfour';
509 SELECT * FROM federated.t1 WHERE id = 5 AND col2 = 'five 5 five five 5'
510 AND col3 = 5;
511 SELECT * FROM federated.t1 WHERE id = 5 AND col2 = 'five 5 five five 5'
512 AND col3 = 5
513 AND col4 = 55555;
514 SELECT * FROM federated.t1 WHERE id = 5
515 AND col2 = 'Two two' AND col3 = 22
516 AND col4 = 33;
517 SELECT * FROM federated.t1 WHERE id = 5
518 AND col2 = 'five 5 five five 5' AND col3 = 5
519 AND col4 = 55555;
520 --sorted_result
521 SELECT * FROM federated.t1 WHERE (id = 5 AND col2 = 'five 5 five five 5')
522 OR (col2 = 'three Three' AND col3 = 33);
523 # Bug#35362984 Memory leak with index merge union plan
524 SELECT /*+ INDEX_MERGE(t1 PRIMARY,col3) */* FROM federated.t1 WHERE (id = 5 AND col2 = 'Two two')
525 OR (col2 = 444 AND col3 = 4444444);
526 --sorted_result
527 SELECT * FROM federated.t1 WHERE id = 1
528 OR col1 = 10
529 OR col2 = 'Two two'
530 OR col3 = 33
531 OR col4 = 4444444;
532 --sorted_result
533 SELECT * FROM federated.t1 WHERE id > 5;
534 --sorted_result
535 SELECT * FROM federated.t1 WHERE id >= 5;
536 --sorted_result
537 SELECT * FROM federated.t1 WHERE id < 5;
538 --sorted_result
539 SELECT * FROM federated.t1 WHERE id <= 5;
540 --sorted_result
541 SELECT * FROM federated.t1 WHERE id != 5;
542 --sorted_result
543 SELECT * FROM federated.t1 WHERE id > 3 AND id < 7;
544 --sorted_result
545 SELECT * FROM federated.t1 WHERE id > 3 AND id <= 7;
546 --sorted_result
547 SELECT * FROM federated.t1 WHERE id >= 3 AND id <= 7;
548 SELECT * FROM federated.t1 WHERE id < 3 AND id <= 7;
549 SELECT * FROM federated.t1 WHERE id < 3 AND id > 7;
550 --sorted_result
551 SELECT * FROM federated.t1 WHERE id < 3 OR id > 7;
552 SELECT * FROM federated.t1 WHERE col2 = 'three Three';
553 --sorted_result
554 SELECT * FROM federated.t1 WHERE col2 > 'one';
555 --sorted_result
556 SELECT * FROM federated.t1 WHERE col2 LIKE 's%';
557 SELECT * FROM federated.t1 WHERE col2 LIKE 'si%';
558 SELECT * FROM federated.t1 WHERE col2 LIKE 'se%';
559 --sorted_result
560 SELECT * FROM federated.t1 WHERE col2 NOT LIKE 'e%';
561 --sorted_result
562 SELECT * FROM federated.t1 WHERE col2 <> 'one One';
563
564 # more multi-column indexes, in the primary key
565 connection slave;
566 DROP TABLE IF EXISTS federated.t1;
567 CREATE TABLE federated.t1 (
568 `col1` varchar(8) NOT NULL DEFAULT '',
569 `col2` varchar(128) NOT NULL DEFAULT '',
570 `col3` varchar(20) NOT NULL DEFAULT '',
571 `col4` varchar(40) NOT NULL DEFAULT '',
572 primary key (`col1`, `col2`, `col3`, `col4`),
573 key 3key(`col2`,`col3`,`col4`),
574 key 2key (`col3`,`col4`),
575 key col4(col4));
576
577 connection master;
578 DROP TABLE IF EXISTS federated.t1;
579 --replace_result $SLAVE_MYPORT SLAVE_PORT
580 eval CREATE TABLE federated.t1 (
581 `col1` varchar(8) NOT NULL DEFAULT '',
582 `col2` varchar(128) NOT NULL DEFAULT '',
583 `col3` varchar(20) NOT NULL DEFAULT '',
584 `col4` varchar(40) NOT NULL DEFAULT '',
585 primary key (`col1`, `col2`, `col3`, `col4`),
586 key 3key(`col2`,`col3`,`col4`),
587 key 2key (`col3`,`col4`),
588 key col4(col4))
589 ENGINE="FEDERATED"
590 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
591
592 INSERT INTO federated.t1 (col1, col2, col3, col4)
593 VALUES ('aaaa', 'aaaaaaaaaaaaaaaaaaa', 'ababababab', 'acacacacacacacac');
594 INSERT INTO federated.t1 (col1, col2, col3, col4)
595 VALUES ('bbbb', 'bbbbbbbbbbbbbbbbbbb', 'bababababa', 'bcbcbcbcbcbcbcbc');
596 INSERT INTO federated.t1 (col1, col2, col3, col4)
597 VALUES ('cccc', 'ccccccccccccccccccc', 'cacacacaca', 'cbcbcbcbcbcbcbcb');
598 INSERT INTO federated.t1 (col1, col2, col3, col4)
599 VALUES ('dddd', 'ddddddddddddddddddd', 'dadadadada', 'dcdcdcdcdcdcdcdc');
600 INSERT INTO federated.t1 (col1, col2, col3, col4)
601 VALUES ('eeee', 'eeeeeeeeeeeeeeeeeee', 'eaeaeaeaea', 'ecececececececec');
602 INSERT INTO federated.t1 (col1, col2, col3, col4)
603 VALUES ('ffff', 'fffffffffffffffffff', 'fafafafafa', 'fcfcfcfcfcfcfcfc');
604 INSERT INTO federated.t1 (col1, col2, col3, col4)
605 VALUES ('gggg', 'ggggggggggggggggggg', 'gagagagaga', 'gcgcgcgcgcgcgcgc');
606 INSERT INTO federated.t1 (col1, col2, col3, col4)
607 VALUES ('hhhh', 'hhhhhhhhhhhhhhhhhhh', 'hahahahaha', 'hchchchchchchchc');
608
609 SELECT * FROM federated.t1 WHERE col1 = 'cccc';
610 SELECT * FROM federated.t1 WHERE col2 = 'eeeeeeeeeeeeeeeeeee';
611 SELECT * FROM federated.t1 WHERE col3 = 'bababababa';
612 SELECT * FROM federated.t1 WHERE col1 = 'gggg' AND col2 = 'ggggggggggggggggggg';
613 SELECT * FROM federated.t1 WHERE col1 = 'gggg' AND col3 = 'gagagagaga';
614 SELECT * FROM federated.t1 WHERE col1 = 'ffff' AND col4 = 'fcfcfcfcfcfcfcfc';
615 --sorted_result
616 SELECT * FROM federated.t1 WHERE col1 > 'bbbb';
617 --sorted_result
618 SELECT * FROM federated.t1 WHERE col1 >= 'bbbb';
619 SELECT * FROM federated.t1 WHERE col1 < 'bbbb';
620 --sorted_result
621 SELECT * FROM federated.t1 WHERE col1 <= 'bbbb';
622 --sorted_result
623 SELECT * FROM federated.t1 WHERE col1 <> 'bbbb';
624 SELECT * FROM federated.t1 WHERE col1 LIKE 'b%';
625 --sorted_result
626 SELECT * FROM federated.t1 WHERE col4 LIKE '%b%';
627 --sorted_result
628 SELECT * FROM federated.t1 WHERE col1 NOT LIKE 'c%';
629 SELECT * FROM federated.t1 WHERE col4 NOT LIKE '%c%';
630 connection slave;
631 DROP TABLE IF EXISTS federated.t1;
632 CREATE TABLE federated.t1 (
633 `col1` varchar(8) NOT NULL DEFAULT '',
634 `col2` int(8) NOT NULL DEFAULT 0,
635 `col3` varchar(8) NOT NULL DEFAULT '',
636 primary key (`col1`, `col2`, `col3`));
637
638 connection master;
639 DROP TABLE IF EXISTS federated.t1;
640 --replace_result $SLAVE_MYPORT SLAVE_PORT
641 eval CREATE TABLE federated.t1 (
642 `col1` varchar(8) NOT NULL DEFAULT '',
643 `col2` varchar(8) NOT NULL DEFAULT '',
644 `col3` varchar(8) NOT NULL DEFAULT '',
645 primary key (`col1`, `col2`, `col3`))
646 ENGINE="FEDERATED"
647 DEFAULT CHARSET=latin1
648 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
649
650 INSERT INTO federated.t1 VALUES ('a00', '110', 'cc0');
651 INSERT INTO federated.t1 VALUES ('aaa', '111', 'ccc');
652 INSERT INTO federated.t1 VALUES ('bbb', '222', 'yyy');
653 INSERT INTO federated.t1 VALUES ('ccc', '111', 'zzz');
654 INSERT INTO federated.t1 VALUES ('ccd', '112', 'zzzz');
655
656 # let's see what the foreign database says
657 connection slave;
658 --sorted_result
659 SELECT col3 FROM federated.t1 WHERE (
660 (col1 = 'aaa' AND col2 >= '111') OR col1 > 'aaa') AND
661 (col1 < 'ccc' OR ( col1 = 'ccc' AND col2 <= '111'));
662
663 connection master;
664 --sorted_result
665 SELECT col3 FROM federated.t1 WHERE (
666 (col1 = 'aaa' AND col2 >= '111') OR col1 > 'aaa') AND
667 (col1 < 'ccc' OR ( col1 = 'ccc' AND col2 <= '111'));
668
669 # test NULLs
670 connection slave;
671 DROP TABLE IF EXISTS federated.t1;
672 CREATE TABLE federated.t1 (
673 `id` int,
674 `name` varchar(32),
675 `floatval` float,
676 `other` int)
677 DEFAULT CHARSET=latin1;
678
679 connection master;
680 DROP TABLE IF EXISTS federated.t1;
681 --replace_result $SLAVE_MYPORT SLAVE_PORT
682 eval CREATE TABLE federated.t1 (
683 `id` int,
684 `name` varchar(32),
685 `floatval` float,
686 `other` int)
687 ENGINE="FEDERATED"
688 DEFAULT CHARSET=latin1
689 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
690
691 # these both should be the same
692 INSERT INTO federated.t1 values (NULL, NULL, NULL, NULL);
693 INSERT INTO federated.t1 values ();
694 INSERT INTO federated.t1 (id) VALUES (1);
695 INSERT INTO federated.t1 (name, floatval, other)
696 VALUES ('foo', 33.33333332, NULL);
697 INSERT INTO federated.t1 (name, floatval, other)
698 VALUES (0, 00.3333, NULL);
699 --sorted_result
700 SELECT * FROM federated.t1;
701 SELECT count(*) FROM federated.t1
702 WHERE id IS NULL
703 AND name IS NULL
704 AND floatval IS NULL
705 AND other IS NULL;
706
707 connection slave;
708 DROP TABLE IF EXISTS federated.t1;
709 SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
710 CREATE TABLE federated.t1 (
711 `blurb_id` int NOT NULL DEFAULT 0,
712 `blurb` text default '',
713 PRIMARY KEY (blurb_id))
714 DEFAULT CHARSET=latin1;
715 SET sql_mode = default;
716 connection master;
717 DROP TABLE IF EXISTS federated.t1;
718 SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
719 --replace_result $SLAVE_MYPORT SLAVE_PORT
720 eval CREATE TABLE federated.t1 (
721 `blurb_id` int NOT NULL DEFAULT 0,
722 `blurb` text default '',
723 PRIMARY KEY (blurb_id))
724 ENGINE="FEDERATED"
725 DEFAULT CHARSET=latin1
726 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
727 SET sql_mode = default;
728 INSERT INTO federated.t1 VALUES (1, " MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values.");
729 INSERT INTO federated.t1 VALUES (2, "All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE.");
730 INSERT INTO federated.t1 VALUES (3, " A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined. ");
731 INSERT INTO federated.t1 VALUES(4, "Die Übersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest für jemanden, der seine Zielsprache ernst nimmt:");
732 --sorted_result
733 SELECT * FROM federated.t1;
734
735 connection slave;
736 DROP TABLE IF EXISTS federated.t1;
737 CREATE TABLE federated.t1 (
738 `a` int NOT NULL,
739 `b` int NOT NULL,
740 `c` int NOT NULL,
741 PRIMARY KEY (a),key(b));
742
743 connection master;
744 DROP TABLE IF EXISTS federated.t1;
745 --replace_result $SLAVE_MYPORT SLAVE_PORT
746 eval CREATE TABLE federated.t1 (
747 `a` int NOT NULL,
748 `b` int NOT NULL,
749 `c` int NOT NULL,
750 PRIMARY KEY (a),
751 KEY (b))
752 ENGINE="FEDERATED"
753 DEFAULT CHARSET=latin1
754 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
755
756 INSERT INTO federated.t1 VALUES (3,3,3),(1,1,1),(2,2,2),(4,4,4);
757
758 connection slave;
759 DROP TABLE IF EXISTS federated.t1;
760
761 CREATE TABLE federated.t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
762 int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17
763 int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
764 i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34
765 int, i35 int, i36 int, i37 int, i38 int, i39 int, i40 int, i41 int, i42 int,
766 i43 int, i44 int, i45 int, i46 int, i47 int, i48 int, i49 int, i50 int, i51
767 int, i52 int, i53 int, i54 int, i55 int, i56 int, i57 int, i58 int, i59 int,
768 i60 int, i61 int, i62 int, i63 int, i64 int, i65 int, i66 int, i67 int, i68
769 int, i69 int, i70 int, i71 int, i72 int, i73 int, i74 int, i75 int, i76 int,
770 i77 int, i78 int, i79 int, i80 int, i81 int, i82 int, i83 int, i84 int, i85
771 int, i86 int, i87 int, i88 int, i89 int, i90 int, i91 int, i92 int, i93 int,
772 i94 int, i95 int, i96 int, i97 int, i98 int, i99 int, i100 int, i101 int, i102
773 int, i103 int, i104 int, i105 int, i106 int, i107 int, i108 int, i109 int, i110
774 int, i111 int, i112 int, i113 int, i114 int, i115 int, i116 int, i117 int, i118
775 int, i119 int, i120 int, i121 int, i122 int, i123 int, i124 int, i125 int, i126
776 int, i127 int, i128 int, i129 int, i130 int, i131 int, i132 int, i133 int, i134
777 int, i135 int, i136 int, i137 int, i138 int, i139 int, i140 int, i141 int, i142
778 int, i143 int, i144 int, i145 int, i146 int, i147 int, i148 int, i149 int, i150
779 int, i151 int, i152 int, i153 int, i154 int, i155 int, i156 int, i157 int, i158
780 int, i159 int, i160 int, i161 int, i162 int, i163 int, i164 int, i165 int, i166
781 int, i167 int, i168 int, i169 int, i170 int, i171 int, i172 int, i173 int, i174
782 int, i175 int, i176 int, i177 int, i178 int, i179 int, i180 int, i181 int, i182
783 int, i183 int, i184 int, i185 int, i186 int, i187 int, i188 int, i189 int, i190
784 int, i191 int, i192 int, i193 int, i194 int, i195 int, i196 int, i197 int, i198
785 int, i199 int, i200 int, i201 int, i202 int, i203 int, i204 int, i205 int, i206
786 int, i207 int, i208 int, i209 int, i210 int, i211 int, i212 int, i213 int, i214
787 int, i215 int, i216 int, i217 int, i218 int, i219 int, i220 int, i221 int, i222
788 int, i223 int, i224 int, i225 int, i226 int, i227 int, i228 int, i229 int, i230
789 int, i231 int, i232 int, i233 int, i234 int, i235 int, i236 int, i237 int, i238
790 int, i239 int, i240 int, i241 int, i242 int, i243 int, i244 int, i245 int, i246
791 int, i247 int, i248 int, i249 int, i250 int, i251 int, i252 int, i253 int, i254
792 int, i255 int, i256 int, i257 int, i258 int, i259 int, i260 int, i261 int, i262
793 int, i263 int, i264 int, i265 int, i266 int, i267 int, i268 int, i269 int, i270
794 int, i271 int, i272 int, i273 int, i274 int, i275 int, i276 int, i277 int, i278
795 int, i279 int, i280 int, i281 int, i282 int, i283 int, i284 int, i285 int, i286
796 int, i287 int, i288 int, i289 int, i290 int, i291 int, i292 int, i293 int, i294
797 int, i295 int, i296 int, i297 int, i298 int, i299 int, i300 int, i301 int, i302
798 int, i303 int, i304 int, i305 int, i306 int, i307 int, i308 int, i309 int, i310
799 int, i311 int, i312 int, i313 int, i314 int, i315 int, i316 int, i317 int, i318
800 int, i319 int, i320 int, i321 int, i322 int, i323 int, i324 int, i325 int, i326
801 int, i327 int, i328 int, i329 int, i330 int, i331 int, i332 int, i333 int, i334
802 int, i335 int, i336 int, i337 int, i338 int, i339 int, i340 int, i341 int, i342
803 int, i343 int, i344 int, i345 int, i346 int, i347 int, i348 int, i349 int, i350
804 int, i351 int, i352 int, i353 int, i354 int, i355 int, i356 int, i357 int, i358
805 int, i359 int, i360 int, i361 int, i362 int, i363 int, i364 int, i365 int, i366
806 int, i367 int, i368 int, i369 int, i370 int, i371 int, i372 int, i373 int, i374
807 int, i375 int, i376 int, i377 int, i378 int, i379 int, i380 int, i381 int, i382
808 int, i383 int, i384 int, i385 int, i386 int, i387 int, i388 int, i389 int, i390
809 int, i391 int, i392 int, i393 int, i394 int, i395 int, i396 int, i397 int, i398
810 int, i399 int, i400 int, i401 int, i402 int, i403 int, i404 int, i405 int, i406
811 int, i407 int, i408 int, i409 int, i410 int, i411 int, i412 int, i413 int, i414
812 int, i415 int, i416 int, i417 int, i418 int, i419 int, i420 int, i421 int, i422
813 int, i423 int, i424 int, i425 int, i426 int, i427 int, i428 int, i429 int, i430
814 int, i431 int, i432 int, i433 int, i434 int, i435 int, i436 int, i437 int, i438
815 int, i439 int, i440 int, i441 int, i442 int, i443 int, i444 int, i445 int, i446
816 int, i447 int, i448 int, i449 int, i450 int, i451 int, i452 int, i453 int, i454
817 int, i455 int, i456 int, i457 int, i458 int, i459 int, i460 int, i461 int, i462
818 int, i463 int, i464 int, i465 int, i466 int, i467 int, i468 int, i469 int, i470
819 int, i471 int, i472 int, i473 int, i474 int, i475 int, i476 int, i477 int, i478
820 int, i479 int, i480 int, i481 int, i482 int, i483 int, i484 int, i485 int, i486
821 int, i487 int, i488 int, i489 int, i490 int, i491 int, i492 int, i493 int, i494
822 int, i495 int, i496 int, i497 int, i498 int, i499 int, i500 int, i501 int, i502
823 int, i503 int, i504 int, i505 int, i506 int, i507 int, i508 int, i509 int, i510
824 int, i511 int, i512 int, i513 int, i514 int, i515 int, i516 int, i517 int, i518
825 int, i519 int, i520 int, i521 int, i522 int, i523 int, i524 int, i525 int, i526
826 int, i527 int, i528 int, i529 int, i530 int, i531 int, i532 int, i533 int, i534
827 int, i535 int, i536 int, i537 int, i538 int, i539 int, i540 int, i541 int, i542
828 int, i543 int, i544 int, i545 int, i546 int, i547 int, i548 int, i549 int, i550
829 int, i551 int, i552 int, i553 int, i554 int, i555 int, i556 int, i557 int, i558
830 int, i559 int, i560 int, i561 int, i562 int, i563 int, i564 int, i565 int, i566
831 int, i567 int, i568 int, i569 int, i570 int, i571 int, i572 int, i573 int, i574
832 int, i575 int, i576 int, i577 int, i578 int, i579 int, i580 int, i581 int, i582
833 int, i583 int, i584 int, i585 int, i586 int, i587 int, i588 int, i589 int, i590
834 int, i591 int, i592 int, i593 int, i594 int, i595 int, i596 int, i597 int, i598
835 int, i599 int, i600 int, i601 int, i602 int, i603 int, i604 int, i605 int, i606
836 int, i607 int, i608 int, i609 int, i610 int, i611 int, i612 int, i613 int, i614
837 int, i615 int, i616 int, i617 int, i618 int, i619 int, i620 int, i621 int, i622
838 int, i623 int, i624 int, i625 int, i626 int, i627 int, i628 int, i629 int, i630
839 int, i631 int, i632 int, i633 int, i634 int, i635 int, i636 int, i637 int, i638
840 int, i639 int, i640 int, i641 int, i642 int, i643 int, i644 int, i645 int, i646
841 int, i647 int, i648 int, i649 int, i650 int, i651 int, i652 int, i653 int, i654
842 int, i655 int, i656 int, i657 int, i658 int, i659 int, i660 int, i661 int, i662
843 int, i663 int, i664 int, i665 int, i666 int, i667 int, i668 int, i669 int, i670
844 int, i671 int, i672 int, i673 int, i674 int, i675 int, i676 int, i677 int, i678
845 int, i679 int, i680 int, i681 int, i682 int, i683 int, i684 int, i685 int, i686
846 int, i687 int, i688 int, i689 int, i690 int, i691 int, i692 int, i693 int, i694
847 int, i695 int, i696 int, i697 int, i698 int, i699 int, i700 int, i701 int, i702
848 int, i703 int, i704 int, i705 int, i706 int, i707 int, i708 int, i709 int, i710
849 int, i711 int, i712 int, i713 int, i714 int, i715 int, i716 int, i717 int, i718
850 int, i719 int, i720 int, i721 int, i722 int, i723 int, i724 int, i725 int, i726
851 int, i727 int, i728 int, i729 int, i730 int, i731 int, i732 int, i733 int, i734
852 int, i735 int, i736 int, i737 int, i738 int, i739 int, i740 int, i741 int, i742
853 int, i743 int, i744 int, i745 int, i746 int, i747 int, i748 int, i749 int, i750
854 int, i751 int, i752 int, i753 int, i754 int, i755 int, i756 int, i757 int, i758
855 int, i759 int, i760 int, i761 int, i762 int, i763 int, i764 int, i765 int, i766
856 int, i767 int, i768 int, i769 int, i770 int, i771 int, i772 int, i773 int, i774
857 int, i775 int, i776 int, i777 int, i778 int, i779 int, i780 int, i781 int, i782
858 int, i783 int, i784 int, i785 int, i786 int, i787 int, i788 int, i789 int, i790
859 int, i791 int, i792 int, i793 int, i794 int, i795 int, i796 int, i797 int, i798
860 int, i799 int, i800 int, i801 int, i802 int, i803 int, i804 int, i805 int, i806
861 int, i807 int, i808 int, i809 int, i810 int, i811 int, i812 int, i813 int, i814
862 int, i815 int, i816 int, i817 int, i818 int, i819 int, i820 int, i821 int, i822
863 int, i823 int, i824 int, i825 int, i826 int, i827 int, i828 int, i829 int, i830
864 int, i831 int, i832 int, i833 int, i834 int, i835 int, i836 int, i837 int, i838
865 int, i839 int, i840 int, i841 int, i842 int, i843 int, i844 int, i845 int, i846
866 int, i847 int, i848 int, i849 int, i850 int, i851 int, i852 int, i853 int, i854
867 int, i855 int, i856 int, i857 int, i858 int, i859 int, i860 int, i861 int, i862
868 int, i863 int, i864 int, i865 int, i866 int, i867 int, i868 int, i869 int, i870
869 int, i871 int, i872 int, i873 int, i874 int, i875 int, i876 int, i877 int, i878
870 int, i879 int, i880 int, i881 int, i882 int, i883 int, i884 int, i885 int, i886
871 int, i887 int, i888 int, i889 int, i890 int, i891 int, i892 int, i893 int, i894
872 int, i895 int, i896 int, i897 int, i898 int, i899 int, i900 int, i901 int, i902
873 int, i903 int, i904 int, i905 int, i906 int, i907 int, i908 int, i909 int, i910
874 int, i911 int, i912 int, i913 int, i914 int, i915 int, i916 int, i917 int, i918
875 int, i919 int, i920 int, i921 int, i922 int, i923 int, i924 int, i925 int, i926
876 int, i927 int, i928 int, i929 int, i930 int, i931 int, i932 int, i933 int, i934
877 int, i935 int, i936 int, i937 int, i938 int, i939 int, i940 int, i941 int, i942
878 int, i943 int, i944 int, i945 int, i946 int, i947 int, i948 int, i949 int, i950
879 int, i951 int, i952 int, i953 int, i954 int, i955 int, i956 int, i957 int, i958
880 int, i959 int, i960 int, i961 int, i962 int, i963 int, i964 int, i965 int, i966
881 int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974
882 int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
883 int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
884 int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
885 int, i999 int, i1000 int, b varchar(256))
886 row_format=dynamic;
887 connection master;
888
889 DROP TABLE IF EXISTS federated.t1;
890
891 --replace_result $SLAVE_MYPORT SLAVE_PORT
892 eval CREATE TABLE federated.t1
893 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
894 int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int,
895 i17 int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
896 i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34
897 int, i35 int, i36 int, i37 int, i38 int, i39 int, i40 int, i41 int, i42 int,
898 i43 int, i44 int, i45 int, i46 int, i47 int, i48 int, i49 int, i50 int, i51
899 int, i52 int, i53 int, i54 int, i55 int, i56 int, i57 int, i58 int, i59 int,
900 i60 int, i61 int, i62 int, i63 int, i64 int, i65 int, i66 int, i67 int, i68
901 int, i69 int, i70 int, i71 int, i72 int, i73 int, i74 int, i75 int, i76 int,
902 i77 int, i78 int, i79 int, i80 int, i81 int, i82 int, i83 int, i84 int, i85
903 int, i86 int, i87 int, i88 int, i89 int, i90 int, i91 int, i92 int, i93 int,
904 i94 int, i95 int, i96 int, i97 int, i98 int, i99 int, i100 int, i101 int, i102
905 int, i103 int, i104 int, i105 int, i106 int, i107 int, i108 int, i109 int, i110
906 int, i111 int, i112 int, i113 int, i114 int, i115 int, i116 int, i117 int, i118
907 int, i119 int, i120 int, i121 int, i122 int, i123 int, i124 int, i125 int, i126
908 int, i127 int, i128 int, i129 int, i130 int, i131 int, i132 int, i133 int, i134
909 int, i135 int, i136 int, i137 int, i138 int, i139 int, i140 int, i141 int, i142
910 int, i143 int, i144 int, i145 int, i146 int, i147 int, i148 int, i149 int, i150
911 int, i151 int, i152 int, i153 int, i154 int, i155 int, i156 int, i157 int, i158
912 int, i159 int, i160 int, i161 int, i162 int, i163 int, i164 int, i165 int, i166
913 int, i167 int, i168 int, i169 int, i170 int, i171 int, i172 int, i173 int, i174
914 int, i175 int, i176 int, i177 int, i178 int, i179 int, i180 int, i181 int, i182
915 int, i183 int, i184 int, i185 int, i186 int, i187 int, i188 int, i189 int, i190
916 int, i191 int, i192 int, i193 int, i194 int, i195 int, i196 int, i197 int, i198
917 int, i199 int, i200 int, i201 int, i202 int, i203 int, i204 int, i205 int, i206
918 int, i207 int, i208 int, i209 int, i210 int, i211 int, i212 int, i213 int, i214
919 int, i215 int, i216 int, i217 int, i218 int, i219 int, i220 int, i221 int, i222
920 int, i223 int, i224 int, i225 int, i226 int, i227 int, i228 int, i229 int, i230
921 int, i231 int, i232 int, i233 int, i234 int, i235 int, i236 int, i237 int, i238
922 int, i239 int, i240 int, i241 int, i242 int, i243 int, i244 int, i245 int, i246
923 int, i247 int, i248 int, i249 int, i250 int, i251 int, i252 int, i253 int, i254
924 int, i255 int, i256 int, i257 int, i258 int, i259 int, i260 int, i261 int, i262
925 int, i263 int, i264 int, i265 int, i266 int, i267 int, i268 int, i269 int, i270
926 int, i271 int, i272 int, i273 int, i274 int, i275 int, i276 int, i277 int, i278
927 int, i279 int, i280 int, i281 int, i282 int, i283 int, i284 int, i285 int, i286
928 int, i287 int, i288 int, i289 int, i290 int, i291 int, i292 int, i293 int, i294
929 int, i295 int, i296 int, i297 int, i298 int, i299 int, i300 int, i301 int, i302
930 int, i303 int, i304 int, i305 int, i306 int, i307 int, i308 int, i309 int, i310
931 int, i311 int, i312 int, i313 int, i314 int, i315 int, i316 int, i317 int, i318
932 int, i319 int, i320 int, i321 int, i322 int, i323 int, i324 int, i325 int, i326
933 int, i327 int, i328 int, i329 int, i330 int, i331 int, i332 int, i333 int, i334
934 int, i335 int, i336 int, i337 int, i338 int, i339 int, i340 int, i341 int, i342
935 int, i343 int, i344 int, i345 int, i346 int, i347 int, i348 int, i349 int, i350
936 int, i351 int, i352 int, i353 int, i354 int, i355 int, i356 int, i357 int, i358
937 int, i359 int, i360 int, i361 int, i362 int, i363 int, i364 int, i365 int, i366
938 int, i367 int, i368 int, i369 int, i370 int, i371 int, i372 int, i373 int, i374
939 int, i375 int, i376 int, i377 int, i378 int, i379 int, i380 int, i381 int, i382
940 int, i383 int, i384 int, i385 int, i386 int, i387 int, i388 int, i389 int, i390
941 int, i391 int, i392 int, i393 int, i394 int, i395 int, i396 int, i397 int, i398
942 int, i399 int, i400 int, i401 int, i402 int, i403 int, i404 int, i405 int, i406
943 int, i407 int, i408 int, i409 int, i410 int, i411 int, i412 int, i413 int, i414
944 int, i415 int, i416 int, i417 int, i418 int, i419 int, i420 int, i421 int, i422
945 int, i423 int, i424 int, i425 int, i426 int, i427 int, i428 int, i429 int, i430
946 int, i431 int, i432 int, i433 int, i434 int, i435 int, i436 int, i437 int, i438
947 int, i439 int, i440 int, i441 int, i442 int, i443 int, i444 int, i445 int, i446
948 int, i447 int, i448 int, i449 int, i450 int, i451 int, i452 int, i453 int, i454
949 int, i455 int, i456 int, i457 int, i458 int, i459 int, i460 int, i461 int, i462
950 int, i463 int, i464 int, i465 int, i466 int, i467 int, i468 int, i469 int, i470
951 int, i471 int, i472 int, i473 int, i474 int, i475 int, i476 int, i477 int, i478
952 int, i479 int, i480 int, i481 int, i482 int, i483 int, i484 int, i485 int, i486
953 int, i487 int, i488 int, i489 int, i490 int, i491 int, i492 int, i493 int, i494
954 int, i495 int, i496 int, i497 int, i498 int, i499 int, i500 int, i501 int, i502
955 int, i503 int, i504 int, i505 int, i506 int, i507 int, i508 int, i509 int, i510
956 int, i511 int, i512 int, i513 int, i514 int, i515 int, i516 int, i517 int, i518
957 int, i519 int, i520 int, i521 int, i522 int, i523 int, i524 int, i525 int, i526
958 int, i527 int, i528 int, i529 int, i530 int, i531 int, i532 int, i533 int, i534
959 int, i535 int, i536 int, i537 int, i538 int, i539 int, i540 int, i541 int, i542
960 int, i543 int, i544 int, i545 int, i546 int, i547 int, i548 int, i549 int, i550
961 int, i551 int, i552 int, i553 int, i554 int, i555 int, i556 int, i557 int, i558
962 int, i559 int, i560 int, i561 int, i562 int, i563 int, i564 int, i565 int, i566
963 int, i567 int, i568 int, i569 int, i570 int, i571 int, i572 int, i573 int, i574
964 int, i575 int, i576 int, i577 int, i578 int, i579 int, i580 int, i581 int, i582
965 int, i583 int, i584 int, i585 int, i586 int, i587 int, i588 int, i589 int, i590
966 int, i591 int, i592 int, i593 int, i594 int, i595 int, i596 int, i597 int, i598
967 int, i599 int, i600 int, i601 int, i602 int, i603 int, i604 int, i605 int, i606
968 int, i607 int, i608 int, i609 int, i610 int, i611 int, i612 int, i613 int, i614
969 int, i615 int, i616 int, i617 int, i618 int, i619 int, i620 int, i621 int, i622
970 int, i623 int, i624 int, i625 int, i626 int, i627 int, i628 int, i629 int, i630
971 int, i631 int, i632 int, i633 int, i634 int, i635 int, i636 int, i637 int, i638
972 int, i639 int, i640 int, i641 int, i642 int, i643 int, i644 int, i645 int, i646
973 int, i647 int, i648 int, i649 int, i650 int, i651 int, i652 int, i653 int, i654
974 int, i655 int, i656 int, i657 int, i658 int, i659 int, i660 int, i661 int, i662
975 int, i663 int, i664 int, i665 int, i666 int, i667 int, i668 int, i669 int, i670
976 int, i671 int, i672 int, i673 int, i674 int, i675 int, i676 int, i677 int, i678
977 int, i679 int, i680 int, i681 int, i682 int, i683 int, i684 int, i685 int, i686
978 int, i687 int, i688 int, i689 int, i690 int, i691 int, i692 int, i693 int, i694
979 int, i695 int, i696 int, i697 int, i698 int, i699 int, i700 int, i701 int, i702
980 int, i703 int, i704 int, i705 int, i706 int, i707 int, i708 int, i709 int, i710
981 int, i711 int, i712 int, i713 int, i714 int, i715 int, i716 int, i717 int, i718
982 int, i719 int, i720 int, i721 int, i722 int, i723 int, i724 int, i725 int, i726
983 int, i727 int, i728 int, i729 int, i730 int, i731 int, i732 int, i733 int, i734
984 int, i735 int, i736 int, i737 int, i738 int, i739 int, i740 int, i741 int, i742
985 int, i743 int, i744 int, i745 int, i746 int, i747 int, i748 int, i749 int, i750
986 int, i751 int, i752 int, i753 int, i754 int, i755 int, i756 int, i757 int, i758
987 int, i759 int, i760 int, i761 int, i762 int, i763 int, i764 int, i765 int, i766
988 int, i767 int, i768 int, i769 int, i770 int, i771 int, i772 int, i773 int, i774
989 int, i775 int, i776 int, i777 int, i778 int, i779 int, i780 int, i781 int, i782
990 int, i783 int, i784 int, i785 int, i786 int, i787 int, i788 int, i789 int, i790
991 int, i791 int, i792 int, i793 int, i794 int, i795 int, i796 int, i797 int, i798
992 int, i799 int, i800 int, i801 int, i802 int, i803 int, i804 int, i805 int, i806
993 int, i807 int, i808 int, i809 int, i810 int, i811 int, i812 int, i813 int, i814
994 int, i815 int, i816 int, i817 int, i818 int, i819 int, i820 int, i821 int, i822
995 int, i823 int, i824 int, i825 int, i826 int, i827 int, i828 int, i829 int, i830
996 int, i831 int, i832 int, i833 int, i834 int, i835 int, i836 int, i837 int, i838
997 int, i839 int, i840 int, i841 int, i842 int, i843 int, i844 int, i845 int, i846
998 int, i847 int, i848 int, i849 int, i850 int, i851 int, i852 int, i853 int, i854
999 int, i855 int, i856 int, i857 int, i858 int, i859 int, i860 int, i861 int, i862
1000 int, i863 int, i864 int, i865 int, i866 int, i867 int, i868 int, i869 int, i870
1001 int, i871 int, i872 int, i873 int, i874 int, i875 int, i876 int, i877 int, i878
1002 int, i879 int, i880 int, i881 int, i882 int, i883 int, i884 int, i885 int, i886
1003 int, i887 int, i888 int, i889 int, i890 int, i891 int, i892 int, i893 int, i894
1004 int, i895 int, i896 int, i897 int, i898 int, i899 int, i900 int, i901 int, i902
1005 int, i903 int, i904 int, i905 int, i906 int, i907 int, i908 int, i909 int, i910
1006 int, i911 int, i912 int, i913 int, i914 int, i915 int, i916 int, i917 int, i918
1007 int, i919 int, i920 int, i921 int, i922 int, i923 int, i924 int, i925 int, i926
1008 int, i927 int, i928 int, i929 int, i930 int, i931 int, i932 int, i933 int, i934
1009 int, i935 int, i936 int, i937 int, i938 int, i939 int, i940 int, i941 int, i942
1010 int, i943 int, i944 int, i945 int, i946 int, i947 int, i948 int, i949 int, i950
1011 int, i951 int, i952 int, i953 int, i954 int, i955 int, i956 int, i957 int, i958
1012 int, i959 int, i960 int, i961 int, i962 int, i963 int, i964 int, i965 int, i966
1013 int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974
1014 int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
1015 int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
1016 int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
1017 int, i999 int, i1000 int, b varchar(256))
1018 row_format=dynamic
1019 ENGINE="FEDERATED"
1020 DEFAULT CHARSET=latin1
1021 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
1022
1023 INSERT INTO federated.t1
1024 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1025 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1026 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1027 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1028 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1029 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1030 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1031 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1032 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1033 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1034 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1035 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1036 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1037 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1038 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1039 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1040 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1041 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1042 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1043 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1044 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1045 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1046 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1047 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1048 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1049 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1050 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1051 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1052 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1053 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1054 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1055 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1056 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1057 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1058 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1059 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1060 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1061 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1062 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "PatrickG");
1063 UPDATE federated.t1 SET b=repeat('a',256);
1064 UPDATE federated.t1 SET i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0, i9=0, i10=0;
1065 SELECT * FROM federated.t1 WHERE i9=0 and i10=0;
1066 UPDATE federated.t1 SET i50=20;
1067 SELECT * FROM federated.t1;
1068 DELETE FROM federated.t1 WHERE i51=20;
1069 SELECT * FROM federated.t1;
1070 DELETE FROM federated.t1 WHERE i50=20;
1071 SELECT * FROM federated.t1;
1072
1073 connection slave;
1074 DROP TABLE IF EXISTS federated.t1;
1075 CREATE TABLE federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob NOT NULL, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', PRIMARY KEY(id), index(code), index(fileguts(10))) DEFAULT CHARSET=latin1;
1076
1077 connection master;
1078 DROP TABLE IF EXISTS federated.t1;
1079 --replace_result $SLAVE_MYPORT SLAVE_PORT
1080 eval CREATE TABLE federated.t1 (
1081 id int NOT NULL auto_increment,
1082 code char(20) NOT NULL,
1083 fileguts blob NOT NULL,
1084 creation_date datetime,
1085 entered_time datetime default '2004-04-04 04:04:04',
1086 PRIMARY KEY(id),
1087 index(code),
1088 index(fileguts(10)))
1089 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
1090 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
1091 INSERT INTO federated.t1 (code, fileguts, creation_date) VALUES ('ASDFWERQWETWETAWETA', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2003-03-03 03:03:03');
1092 INSERT INTO federated.t1 (code, fileguts, creation_date) VALUES ('DEUEUEUEUEUEUEUEUEU', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2004-04-04 04:04:04');
1093 INSERT INTO federated.t1 (code, fileguts, creation_date) VALUES ('DEUEUEUEUEUEUEUEUEU', 'jimbob', '2004-04-04 04:04:04');
1094 --sorted_result
1095 SELECT * FROM federated.t1;
1096 # test blob indexes
1097 SELECT * FROM federated.t1 WHERE fileguts = 'jimbob';
1098
1099 # test blob with binary
1100 connection slave;
1101 DROP TABLE IF EXISTS federated.t1;
1102 CREATE TABLE federated.t1 (`a` BLOB);
1103
1104 connection master;
1105 DROP TABLE IF EXISTS federated.t1;
1106 --replace_result $SLAVE_MYPORT SLAVE_PORT
1107 eval CREATE TABLE federated.t1 (
1108 `a` BLOB)
1109 ENGINE="FEDERATED"
1110 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
1111
1112 INSERT INTO federated.t1 VALUES (0x00);
1113 INSERT INTO federated.t1 VALUES (0x0001);
1114 INSERT INTO federated.t1 VALUES (0x0100);
1115 --sorted_result
1116 SELECT HEX(a) FROM federated.t1;
1117
1118 # # simple tests for cyrillic, given to me by
1119 # DROP TABLE IF EXISTS federated.t1;
1120 # --replace_result $SLAVE_MYPORT SLAVE_PORT
1121 # eval CREATE TABLE federated.t1
1122 # (a char(20)) charset=cp1251
1123 # ENGINE="FEDERATED" CONNECTION="mysql://[email protected]:$SLAVE_MYPORT/federated/t1";
1124 # #
1125 # connection slave;
1126 # DROP TABLE IF EXISTS federated.t1;
1127 # CREATE TABLE federated.t1 (a char(20)) charset=cp1251;
1128 # #
1129 # connection master;
1130 # INSERT INTO federated.t1 values (_cp1251'�-���-1');
1131 # INSERT INTO federated.t1 values (_cp1251'�-���-2');
1132 # SELECT * FROM federated.t1;
1133 # SET names cp1251;
1134 # INSERT INTO federated.t1 values ('�-���-3');
1135 # INSERT INTO federated.t1 values ('�-Ũ�-4');
1136 # SELECT * FROM federated.t1;
1137 # SELECT hex(a) from federated.t1;
1138 # SELECT hex(a) from federated.t1 ORDER BY a desc;
1139 # UPDATE federated.t1 SET a='�-���-1�����' WHERE a='�-���-1';
1140 # SELECT * FROM federated.t1;
1141 # DELETE FROM federated.t1 WHERE a='�-Ũ�-4';
1142 # SELECT * FROM federated.t1;
1143 # DELETE FROM federated.t1 WHERE a>'�-';
1144 # SELECT * FROM federated.t1;
1145 # SET names default;
1146 # DROP TABLE IF EXISTS federated.t1;
1147
1148 #
1149 # DROP TABLE IF EXISTS federated.t1;
1150 #
1151
1152 # test joins with non-federated table
1153 connection slave;
1154 DROP TABLE IF EXISTS federated.t1;
1155 CREATE TABLE federated.t1 (
1156 `id` int(20) NOT NULL auto_increment,
1157 `country_id` int(20) NOT NULL DEFAULT 0,
1158 `name` varchar(32),
1159 `other` varchar(20),
1160 PRIMARY KEY (`id`),
1161 key (country_id));
1162
1163 connection master;
1164 DROP TABLE IF EXISTS federated.countries;
1165 CREATE TABLE federated.countries (
1166 `id` int(20) NOT NULL auto_increment,
1167 `country` varchar(32),
1168 PRIMARY KEY (id));
1169 INSERT INTO federated.countries (country) VALUES ('India');
1170 INSERT INTO federated.countries (country) VALUES ('Germany');
1171 INSERT INTO federated.countries (country) VALUES ('Italy');
1172 INSERT INTO federated.countries (country) VALUES ('Finland');
1173 INSERT INTO federated.countries (country) VALUES ('Ukraine');
1174
1175 DROP TABLE IF EXISTS federated.t1;
1176 --replace_result $SLAVE_MYPORT SLAVE_PORT
1177 eval CREATE TABLE federated.t1 (
1178 `id` int(20) NOT NULL auto_increment,
1179 `country_id` int(20) NOT NULL DEFAULT 0,
1180 `name` varchar(32),
1181 `other` varchar(20),
1182 PRIMARY KEY (`id`),
1183 KEY (country_id) )
1184 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
1185 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
1186
1187 INSERT INTO federated.t1 (name, country_id, other) VALUES ('Kumar', 1, 11111);
1188 INSERT INTO federated.t1 (name, country_id, other) VALUES ('Lenz', 2, 22222);
1189 INSERT INTO federated.t1 (name, country_id, other) VALUES ('Marizio', 3, 33333);
1190 INSERT INTO federated.t1 (name, country_id, other) VALUES ('Monty', 4, 33333);
1191 INSERT INTO federated.t1 (name, country_id, other) VALUES ('Sanja', 5, 33333);
1192
1193 #inner join
1194 --sorted_result
1195 SELECT federated.t1.name AS name, federated.t1.country_id AS country_id,
1196 federated.t1.other AS other, federated.countries.country AS country
1197 FROM federated.t1, federated.countries WHERE
1198 federated.t1.country_id = federated.countries.id;
1199
1200 SELECT federated.t1.name AS name, federated.t1.country_id AS country_id,
1201 federated.t1.other AS other, federated.countries.country AS country
1202 FROM federated.t1 INNER JOIN federated.countries ON
1203 federated.t1.country_id = federated.countries.id;
1204
1205 SELECT federated.t1.name AS name, federated.t1.country_id AS country_id,
1206 federated.t1.other AS other, federated.countries.country AS country
1207 FROM federated.t1 INNER JOIN federated.countries ON
1208 federated.t1.country_id = federated.countries.id
1209 WHERE federated.t1.name = 'Monty';
1210
1211 #left join
1212 SELECT federated.t1.*, federated.countries.country
1213 FROM federated.t1 LEFT JOIN federated.countries
1214 ON federated.t1.country_id = federated.countries.id
1215 ORDER BY federated.countries.id;
1216
1217 SELECT federated.t1.*, federated.countries.country
1218 FROM federated.t1 LEFT JOIN federated.countries
1219 ON federated.t1.country_id = federated.countries.id
1220 ORDER BY federated.countries.country;
1221
1222 #right join
1223 SELECT federated.t1.*, federated.countries.country
1224 FROM federated.t1 RIGHT JOIN federated.countries
1225 ON federated.t1.country_id = federated.countries.id
1226 ORDER BY federated.t1.country_id;
1227
1228 DROP TABLE federated.countries;
1229
1230 #BEGIN optimize and repair tests
1231 OPTIMIZE TABLE federated.t1;
1232 REPAIR TABLE federated.t1;
1233 REPAIR TABLE federated.t1 QUICK;
1234 REPAIR TABLE federated.t1 EXTENDED;
1235 REPAIR TABLE federated.t1 USE_FRM;
1236 #END optimize and repair tests
1237
1238
1239 # BEGIN ALTER TEST
1240 connection slave;
1241 --disable_warnings
1242 DROP TABLE IF EXISTS federated.normal_table;
1243 --enable_warnings
1244
1245 CREATE TABLE federated.normal_table (
1246 `id` int(4) NOT NULL,
1247 `name` varchar(10) default NULL
1248 ) DEFAULT CHARSET=latin1;
1249
1250 connection master;
1251 --disable_warnings
1252 DROP TABLE IF EXISTS federated.alter_me;
1253 --enable_warnings
1254
1255 --replace_result $SLAVE_MYPORT SLAVE_PORT
1256 eval CREATE TABLE federated.alter_me (
1257 `id` int(4) NOT NULL,
1258 `name` varchar(10) default NULL,
1259 PRIMARY KEY (`id`)
1260 ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1
1261 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/normal_table';
1262
1263 INSERT INTO federated.alter_me (id, name) VALUES (1, 'Monty');
1264 INSERT INTO federated.alter_me (id, name) VALUES (2, 'David');
1265
1266 SELECT * FROM federated.alter_me;
1267
1268 --error ER_ILLEGAL_HA
1269 ALTER TABLE federated.alter_me MODIFY COLUMN id int(16) NOT NULL;
1270
1271 SELECT * FROM federated.alter_me;
1272
1273 DROP TABLE federated.alter_me;
1274 connection slave;
1275 DROP TABLE federated.normal_table;
1276 # END ALTER TEST
1277
1278 #
1279 # Test BUG #14532 - bit columns broken in federated
1280 # storage engine
1281 #
1282 --disable_warnings
1283 DROP TABLE IF EXISTS federated.t1;
1284 --enable_warnings
1285 CREATE TABLE federated.t1 (
1286 `bitty` bit(3)
1287 ) DEFAULT CHARSET=latin1;
1288
1289 connection master;
1290
1291 --disable_warnings
1292 DROP TABLE IF EXISTS federated.t1;
1293 --enable_warnings
1294
1295 --replace_result $SLAVE_MYPORT SLAVE_PORT
1296 eval CREATE TABLE federated.t1 (
1297 `bitty` bit(3)
1298 ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1
1299 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
1300
1301 INSERT INTO federated.t1 VALUES (b'001');
1302 INSERT INTO federated.t1 VALUES (b'010');
1303 INSERT INTO federated.t1 VALUES (b'011');
1304 INSERT INTO federated.t1 VALUES (b'100');
1305 INSERT INTO federated.t1 VALUES (b'101');
1306 INSERT INTO federated.t1 VALUES (b'110');
1307 INSERT INTO federated.t1 VALUES (b'111');
1308 select * FROM federated.t1;
1309 drop table federated.t1;
1310
1311 connection slave;
1312 drop table federated.t1;
1313
1314 #
1315 # BUG# 14768 test auto_increment last_insert_id()
1316 #
1317 connection slave;
1318 DROP TABLE IF EXISTS federated.t1;
1319 CREATE TABLE federated.t1 (
1320 `id` int(20) NOT NULL auto_increment,
1321 PRIMARY KEY (`id`));
1322
1323 connection master;
1324 DROP TABLE IF EXISTS federated.t1;
1325 --replace_result $SLAVE_MYPORT SLAVE_PORT
1326 eval CREATE TABLE federated.t1 (
1327 `id` int(20) NOT NULL auto_increment,
1328 PRIMARY KEY (`id`)
1329 )
1330 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
1331 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
1332
1333 INSERT INTO federated.t1 VALUES ();
1334 SELECT LAST_INSERT_ID();
1335 INSERT INTO federated.t1 VALUES ();
1336 SELECT LAST_INSERT_ID();
1337 INSERT INTO federated.t1 VALUES ();
1338 SELECT LAST_INSERT_ID();
1339 INSERT INTO federated.t1 VALUES ();
1340 SELECT LAST_INSERT_ID();
1341 INSERT INTO federated.t1 VALUES ();
1342 SELECT LAST_INSERT_ID();
1343 SELECT * FROM federated.t1;
1344 DROP TABLE federated.t1;
1345
1346 connection slave;
1347 DROP TABLE federated.t1;
1348
1349 #
1350 # Bug#17377 Federated Engine returns wrong Data, always the rows
1351 # with the highest ID
1352 #
1353
1354 connection slave;
1355
1356 --disable_warnings
1357 DROP TABLE IF EXISTS federated.bug_17377_table;
1358 --enable_warnings
1359
1360 CREATE TABLE federated.bug_17377_table (
1361 `fld_cid` bigint(20) NOT NULL auto_increment,
1362 `fld_name` varchar(255) NOT NULL default '',
1363 `fld_parentid` bigint(20) NOT NULL default '0',
1364 `fld_delt` int(1) NOT NULL default '0',
1365 PRIMARY KEY (`fld_cid`),
1366 KEY `fld_parentid` (`fld_parentid`),
1367 KEY `fld_delt` (`fld_delt`),
1368 KEY `fld_cid` (`fld_cid`)
1369 ) ENGINE=MyISAM;
1370
1371 # Insert some test-data
1372 insert into federated.bug_17377_table( fld_name )
1373 values
1374 ("Mats"), ("Sivert"), ("Sigvard"), ("Torgny"), ("Torkel");
1375
1376 connection master;
1377 --disable_warnings
1378 DROP TABLE IF EXISTS federated.t1;
1379 --enable_warnings
1380
1381 --replace_result $SLAVE_MYPORT SLAVE_PORT
1382 eval CREATE TABLE federated.t1 (
1383 `fld_cid` bigint(20) NOT NULL auto_increment,
1384 `fld_name` varchar(255) NOT NULL default '',
1385 `fld_parentid` bigint(20) NOT NULL default '0',
1386 `fld_delt` int(1) NOT NULL default '0',
1387 PRIMARY KEY (`fld_cid`),
1388 KEY `fld_parentid` (`fld_parentid`),
1389 KEY `fld_delt` (`fld_delt`),
1390 KEY `fld_cid` (`fld_cid`)
1391 ) ENGINE=FEDERATED
1392 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/bug_17377_table';
1393
1394 select * from federated.t1 where fld_parentid=0 and fld_delt=0
1395 order by fld_name;
1396
1397 select * from federated.t1 where fld_parentid=0 and fld_delt=0;
1398
1399 DROP TABLE federated.t1;
1400 connection slave;
1401 DROP TABLE federated.bug_17377_table;
1402
1403 #
1404 # Test multi updates and deletes without keys
1405 #
1406
1407 # The following can be enabled when bug #19773 has been fixed
1408 --disable_testcase BUG#19773
1409 connection slave;
1410 create table federated.t1 (i1 int, i2 int, i3 int);
1411 create table federated.t2 (id int, c1 varchar(20), c2 varchar(20));
1412 connection master;
1413 eval create table federated.t1 (i1 int, i2 int, i3 int) ENGINE=FEDERATED CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
1414 eval create table federated.t2 (id int, c1 varchar(20), c2 varchar(20)) ENGINE=FEDERATED CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t2';
1415 insert into federated.t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
1416 insert into federated.t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
1417 select * from federated.t1 order by i1;
1418 select * from federated.t2;
1419 update federated.t1,federated.t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
1420 select * from federated.t1 order by i1;
1421 select * from federated.t2 order by id;
1422 delete t1.*,t2.* from federated.t1,federated.t2 where t1.i2=t2.id;
1423 select * from federated.t1 order by i1;
1424 select * from federated.t2 order by id;
1425 drop table federated.t1, federated.t2;
1426 connection slave;
1427 drop table federated.t1, federated.t2;
1428 connection master;
1429
1430 # Test multi updates and deletes with keys
1431
1432 connection slave;
1433 create table federated.t1 (i1 int, i2 int, i3 int, primary key (i1));
1434 create table federated.t2 (id int, c1 varchar(20), c2 varchar(20), primary key (id));
1435 connection master;
1436 eval create table federated.t1 (i1 int auto_increment not null, i2 int, i3 int, primary key (i1)) ENGINE=FEDERATED ENGINE=FEDERATED CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
1437 eval create table federated.t2 (id int auto_increment not null, c1 varchar(20), c2 varchar(20), primary key(id)) ENGINE=FEDERATED ENGINE=FEDERATED CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t2';
1438 insert into federated.t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
1439 insert into federated.t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
1440 select * from federated.t1 order by i1;
1441 select * from federated.t2 order by id;
1442 update federated.t1,federated.t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
1443 select * from federated.t1 order by i1;
1444 select * from federated.t2 order by id;
1445 delete t1.*,t2.* from federated.t1,federated.t2 where t1.i2=t2.id;
1446 select * from federated.t1 order by i1;
1447 select * from federated.t2 order by id;
1448 drop table federated.t1, federated.t2;
1449 connection slave;
1450 drop table federated.t1, federated.t2;
1451 connection master;
1452 --enable_testcase
1453
1454 #
1455 # BUG #18764: Delete conditions causing inconsistencies in Federated tables
1456 #
1457 connection slave;
1458 --disable_warnings
1459 DROP TABLE IF EXISTS federated.test;
1460 --enable_warnings
1461 CREATE TABLE federated.test (
1462 `id` int(11) NOT NULL,
1463 `val1` varchar(255) NOT NULL,
1464 `val2` varchar(255) NOT NULL,
1465 PRIMARY KEY (`id`)
1466 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
1467
1468 connection master;
1469 --disable_warnings
1470 DROP TABLE IF EXISTS federated.test_local;
1471 DROP TABLE IF EXISTS federated.test_remote;
1472 --enable_warnings
1473 CREATE TABLE federated.test_local (
1474 `id` int(11) NOT NULL,
1475 `val1` varchar(255) NOT NULL,
1476 `val2` varchar(255) NOT NULL,
1477 PRIMARY KEY (`id`)
1478 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
1479
1480 INSERT INTO federated.test_local VALUES (1, 'foo', 'bar'),
1481 (2, 'bar', 'foo');
1482
1483 --replace_result $SLAVE_MYPORT SLAVE_PORT
1484 eval CREATE TABLE federated.test_remote (
1485 `id` int(11) NOT NULL,
1486 `val1` varchar(255) NOT NULL,
1487 `val2` varchar(255) NOT NULL,
1488 PRIMARY KEY (`id`)
1489 ) ENGINE=FEDERATED DEFAULT CHARSET=latin1
1490 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/test';
1491
1492 insert into federated.test_remote select * from federated.test_local;
1493
1494 select * from federated.test_remote;
1495
1496 delete from federated.test_remote where id in (1,2);
1497
1498 insert into federated.test_remote select * from federated.test_local;
1499
1500 select * from federated.test_remote;
1501 --disable_warnings
1502 DROP TABLE federated.test_local;
1503 DROP TABLE federated.test_remote;
1504 --enable_warnings
1505 connection slave;
1506 --disable_warnings
1507 DROP TABLE federated.test;
1508 --enable_warnings
1509
1510 #
1511 # Additional test for bug#18437 "Wrong values inserted with a before
1512 # update trigger on NDB table". SQL-layer didn't properly inform
1513 # handler about fields which were read and set in triggers. In some
1514 # cases this resulted in incorrect (garbage) values of OLD variables
1515 # and lost changes to NEW variables.
1516 # Since for federated engine only operation which is affected by wrong
1517 # fields mark-up is handler::write_row() this file constains coverage
1518 # for ON INSERT triggers only. Tests for other types of triggers reside
1519 # in ndb_trigger.test.
1520 #
1521 connection slave;
1522 --disable_warnings
1523 drop table if exists federated.t1;
1524 --enable_warnings
1525 create table federated.t1 (a int, b int, c int);
1526 connection master;
1527 --disable_warnings
1528 drop table if exists federated.t1;
1529 drop table if exists federated.t2;
1530 --enable_warnings
1531 --replace_result $SLAVE_MYPORT SLAVE_PORT
1532 eval create table federated.t1 (a int, b int, c int) engine=federated connection='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
1533 create trigger federated.t1_bi before insert on federated.t1 for each row set new.c= new.a * new.b;
1534 create table federated.t2 (a int, b int);
1535 insert into federated.t2 values (13, 17), (19, 23);
1536 # Each of three statements should correctly set values for all three fields
1537 # insert
1538 insert into federated.t1 (a, b) values (1, 2), (3, 5), (7, 11);
1539 select * from federated.t1 order by a;
1540 delete from federated.t1;
1541 # insert ... select
1542 insert into federated.t1 (a, b) select * from federated.t2;
1543 select * from federated.t1 order by a;
1544 delete from federated.t1;
1545 # load
1546 load data infile '../../std_data/loaddata5.dat' into table federated.t1 fields terminated by '' enclosed by '' ignore 1 lines (a, b);
1547 select * from federated.t1 order by a;
1548 drop tables federated.t1, federated.t2;
1549
1550 connection slave;
1551 drop table federated.t1;
1552
1553 #
1554 # BUG 19773 Crash when using multi-table updates, deletes
1555 # with federated tables
1556 #
1557 connection slave;
1558 create table federated.t1 (i1 int, i2 int, i3 int);
1559 create table federated.t2 (id int, c1 varchar(20), c2 varchar(20));
1560
1561 connection master;
1562 --replace_result $SLAVE_MYPORT SLAVE_PORT
1563 eval create table federated.t1 (i1 int, i2 int, i3 int) ENGINE=FEDERATED CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
1564 --replace_result $SLAVE_MYPORT SLAVE_PORT
1565 eval create table federated.t2 (id int, c1 varchar(20), c2 varchar(20)) ENGINE=FEDERATED CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t2';
1566 insert into federated.t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
1567 insert into federated.t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
1568 select * from federated.t1 order by i1;
1569 select * from federated.t2;
1570 update federated.t1,federated.t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
1571 select * from federated.t1 order by i1;
1572 select * from federated.t2 order by id;
1573 delete federated.t1.*,federated.t2.* from federated.t1,federated.t2 where t1.i2=t2.id;
1574 select * from federated.t1 order by i1;
1575 select * from federated.t2 order by id;
1576 drop table federated.t1, federated.t2;
1577 connection slave;
1578 drop table federated.t1, federated.t2;
1579
1580 # Test multi updates and deletes with keys
1581 connection slave;
1582 create table federated.t1 (i1 int, i2 int, i3 int, primary key (i1));
1583 create table federated.t2 (id int, c1 varchar(20), c2 varchar(20), primary key (id));
1584
1585 connection master;
1586 --replace_result $SLAVE_MYPORT SLAVE_PORT
1587 eval create table federated.t1 (i1 int auto_increment not null, i2 int, i3 int, primary key (i1)) ENGINE=FEDERATED CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
1588 --replace_result $SLAVE_MYPORT SLAVE_PORT
1589 eval create table federated.t2 (id int auto_increment not null, c1 varchar(20), c2 varchar(20), primary key(id)) ENGINE=FEDERATED CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t2';
1590 insert into federated.t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
1591 insert into federated.t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
1592 select * from federated.t1 order by i1;
1593 select * from federated.t2 order by id;
1594 update federated.t1,federated.t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
1595 select * from federated.t1 order by i1;
1596 select * from federated.t2 order by id;
1597 delete federated.t1.*,federated.t2.* from federated.t1,federated.t2 where t1.i2=t2.id;
1598 select * from federated.t1 order by i1;
1599 select * from federated.t2 order by id;
1600 drop table federated.t1, federated.t2;
1601
1602 connection slave;
1603 drop table federated.t1, federated.t2;
1604 #
1605 # Bug #16494: Updates that set a column to NULL fail sometimes
1606 #
1607 connection slave;
1608 create table t1 (id int not null auto_increment primary key, val int);
1609 connection master;
1610 --replace_result $SLAVE_MYPORT SLAVE_PORT
1611 eval create table t1
1612 (id int not null auto_increment primary key, val int) engine=federated
1613 connection='mysql://[email protected]:$SLAVE_MYPORT/test/t1';
1614 insert into t1 values (1,0),(2,0);
1615 update t1 set val = NULL where id = 1;
1616 select * from t1;
1617 connection slave;
1618 select * from t1;
1619 drop table t1;
1620 connection master;
1621 drop table t1;
1622
1623 #
1624 # Bug #17608: String literals lost during INSERT query on FEDERATED table
1625 #
1626 connection slave;
1627 create table t1 (a longblob not null);
1628 connection master;
1629 --replace_result $SLAVE_MYPORT SLAVE_PORT
1630 eval create table t1
1631 (a longblob not null) engine=federated
1632 connection='mysql://[email protected]:$SLAVE_MYPORT/test/t1';
1633 insert into t1 values (repeat('a',5000));
1634 select length(a) from t1;
1635 connection slave;
1636 select length(a) from t1;
1637 drop table t1;
1638 connection master;
1639 drop table t1;
1640
1641 #
1642 # BUG #15133: unique index with nullable value not accepted in federated table
1643 #
1644
1645 connection slave;
1646 --disable_warnings
1647 DROP TABLE IF EXISTS federated.test;
1648 CREATE TABLE federated.test (
1649 `i` int(11) NOT NULL,
1650 `j` int(11) NOT NULL,
1651 `c` varchar(30) default NULL,
1652 PRIMARY KEY (`i`,`j`),
1653 UNIQUE KEY `i` (`i`,`c`)
1654 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
1655 --enable_warnings
1656
1657 connection master;
1658 --disable_warnings
1659 DROP TABLE IF EXISTS federated.test1;
1660 DROP TABLE IF EXISTS federated.test2;
1661 --enable_warnings
1662
1663 --replace_result $SLAVE_MYPORT SLAVE_PORT
1664 eval create table federated.test1 (
1665 i int not null,
1666 j int not null,
1667 c varchar(30),
1668 primary key (i,j),
1669 unique key (i, c))
1670 engine = federated
1671 connection='mysql://[email protected]:$SLAVE_MYPORT/federated/test';
1672
1673 --replace_result $SLAVE_MYPORT SLAVE_PORT
1674 eval create table federated.test2 (
1675 i int default null,
1676 j int not null,
1677 c varchar(30),
1678 key (i))
1679 engine = federated
1680 connection='mysql://[email protected]:$SLAVE_MYPORT/federated/test';
1681 drop table federated.test1, federated.test2;
1682
1683 connection slave;
1684 drop table federated.test;
1685
1686 #
1687 # BUG# 17044 Federated Storage Engine not UTF8 clean
1688 #
1689 connection slave;
1690 set names utf8;
1691 create table federated.t1 (a varchar(64)) DEFAULT CHARSET=utf8;
1692
1693 insert into federated.t1 values (0x6DC3A56E6164);
1694 select hex(a) from federated.t1;
1695
1696 connection master;
1697 --replace_result $SLAVE_MYPORT SLAVE_PORT
1698 eval create table federated.t1 (a varchar(64))
1699 ENGINE=FEDERATED
1700 connection='mysql://[email protected]:$SLAVE_MYPORT/federated/t1'
1701 DEFAULT CHARSET=utf8;
1702 set names utf8;
1703 select hex(a) from federated.t1;
1704 insert into federated.t1 values (0xC3A4C3B6C3BCC39F);
1705 insert into federated.t1 values (0xD18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E);
1706 select hex(a) from federated.t1;
1707
1708 connection slave;
1709 select hex(a) from federated.t1;
1710
1711 connection master;
1712 drop table federated.t1;
1713
1714 connection slave;
1715 drop table federated.t1;
1716
1717 #
1718 # Bug#26909: Specified key was too long; max key length is 255 bytes
1719 # when creating a table
1720 #
1721 connection slave;
1722 CREATE TABLE federated.t1 (
1723 categoryId int(11) NOT NULL AUTO_INCREMENT,
1724 domainId varchar(745) NOT NULL DEFAULT '',
1725 categoryName varchar(255) NOT NULL DEFAULT '',
1726 PRIMARY KEY (categoryId),
1727 UNIQUE KEY idx_unique_category_categoryName (domainId, categoryName),
1728 KEY idx_category_domainId (domainId)
1729 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
1730
1731 connection master;
1732 --replace_result $SLAVE_MYPORT SLAVE_PORT
1733 eval CREATE TABLE federated.t1 (
1734 categoryId int(11) NOT NULL AUTO_INCREMENT,
1735 domainId varchar(745) NOT NULL DEFAULT '',
1736 categoryName varchar(255) NOT NULL DEFAULT '',
1737 PRIMARY KEY (categoryId),
1738 UNIQUE KEY idx_unique_category_categoryName (domainId, categoryName),
1739 KEY idx_category_domainId (domainId)
1740 ) ENGINE=FEDERATED DEFAULT CHARSET=latin1
1741 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
1742
1743
1744 insert into federated.t1 (domainId, categoryName) values ( '1231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231 300', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345 250');
1745 insert into federated.t1 (domainId, categoryName) values ( '12312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312 301', '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456 250');
1746 insert into federated.t1 (domainId, categoryName) values ('a', 'b');
1747
1748 select categoryId from federated.t1 order by domainId, categoryName;
1749 select categoryId from federated.t1 where domainId='a' and categoryName='b' order by categoryId;
1750 select categoryId from federated.t1 where domainId='a' and categoryName='b' order by categoryId;
1751 select categoryId from federated.t1 where domainId<>'a' and categoryName<>'b' order by categoryId;
1752
1753 drop table federated.t1;
1754
1755 connection slave;
1756 drop table federated.t1;
1757
1758 #
1759 # BUG#21019 Federated Engine does not support REPLACE/INSERT IGNORE/UPDATE IGNORE
1760 #
1761 connection slave;
1762 create table federated.t1 (a int primary key, b varchar(64))
1763 DEFAULT CHARSET=utf8;
1764 connection master;
1765 --replace_result $SLAVE_MYPORT SLAVE_PORT
1766 eval create table federated.t1 (a int primary key, b varchar(64))
1767 ENGINE=FEDERATED
1768 connection='mysql://[email protected]:$SLAVE_MYPORT/federated/t1'
1769 DEFAULT CHARSET=utf8;
1770
1771 insert ignore into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
1772 select * from federated.t1;
1773
1774 truncate federated.t1;
1775 replace into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
1776 select * from federated.t1;
1777
1778 update ignore federated.t1 set a=a+1;
1779 select * from federated.t1;
1780
1781 drop table federated.t1;
1782 connection slave;
1783 drop table federated.t1;
1784
1785 #
1786 # BUG#25511 Federated Insert failures.
1787 #
1788 # When the user performs a INSERT...ON DUPLICATE KEY UPDATE, we want
1789 # it to fail if a duplicate key exists instead of ignoring it.
1790 #
1791 connection slave;
1792 create table federated.t1 (a int primary key, b varchar(64))
1793 DEFAULT CHARSET=utf8;
1794 connection master;
1795 --replace_result $SLAVE_MYPORT SLAVE_PORT
1796 eval create table federated.t1 (a int primary key, b varchar(64))
1797 ENGINE=FEDERATED
1798 connection='mysql://[email protected]:$SLAVE_MYPORT/federated/t1'
1799 DEFAULT CHARSET=utf8;
1800
1801 --error ER_DUP_KEY
1802 insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe")
1803 on duplicate key update a=a+100;
1804 select * from federated.t1;
1805
1806 drop table federated.t1;
1807 connection slave;
1808 drop table federated.t1;
1809
1810 --echo
1811 --echo Bug#18287 create federated table always times out, error 1159 ' '
1812 --echo
1813 --echo Test that self-references work
1814 --echo
1815 connection slave;
1816 create table federated.t1 (a int primary key);
1817 --replace_result $SLAVE_MYPORT SLAVE_PORT
1818 eval create table federated.t2 (a int primary key)
1819 ENGINE=FEDERATED
1820 connection='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
1821 insert into federated.t1 (a) values (1);
1822 select * from federated.t2;
1823 drop table federated.t1, federated.t2;
1824
1825 #
1826 # BUG#29875 Disable support for transactions
1827 #
1828 connection slave;
1829 CREATE TABLE federated.t1 (a INT PRIMARY KEY) DEFAULT CHARSET=utf8;
1830 connection master;
1831 --replace_result $SLAVE_MYPORT SLAVE_PORT
1832 eval CREATE TABLE federated.t1 (a INT PRIMARY KEY)
1833 ENGINE=FEDERATED
1834 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1'
1835 DEFAULT CHARSET=utf8;
1836
1837 SELECT transactions FROM information_schema.engines WHERE engine="FEDERATED";
1838 INSERT INTO federated.t1 VALUES (1);
1839 SET autocommit=0;
1840 INSERT INTO federated.t1 VALUES (2);
1841 ROLLBACK;
1842 SET autocommit=1;
1843 SELECT * FROM federated.t1;
1844
1845 DROP TABLE federated.t1;
1846 connection slave;
1847 DROP TABLE federated.t1;
1848
1849 #
1850 # Bug #32374 crash with filesort when selecting from federated table and view
1851 #
1852 connection slave;
1853 create table t1 (a varchar(256));
1854 --disable_warnings
1855 drop view if exists v1;
1856 --enable_warnings
1857 create view v1 as select a from t1;
1858 --disable_query_log
1859 let $n= 100;
1860 while ($n)
1861 {
1862 insert into t1 values (repeat('a',200));
1863 dec $n;
1864 }
1865 --enable_query_log
1866
1867 connection master;
1868 --replace_result $SLAVE_MYPORT SLAVE_PORT
1869 eval create table t1
1870 (a varchar(256)) engine=federated
1871 connection='mysql://[email protected]:$SLAVE_MYPORT/test/v1';
1872
1873 select 1 from t1 order by a;
1874 drop table t1;
1875 connection slave;
1876 drop table t1;
1877 drop view v1;
1878
1879 #
1880 # BUG#33946 - Join on Federated tables with Unique index gives error 1430
1881 # from storage engine
1882 #
1883 connection slave;
1884 CREATE TABLE t1 (a INT, b INT, KEY(a,b));
1885 INSERT INTO t1 VALUES(NULL,1),(1,NULL),(NULL,NULL),(1,1),(2,2);
1886
1887 connection master;
1888 --replace_result $SLAVE_MYPORT SLAVE_PORT
1889 eval CREATE TABLE t1 (a INT, b INT, KEY(a,b)) ENGINE=federated
1890 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/test/t1';
1891 --sorted_result
1892 SELECT * FROM t1 WHERE a IS NULL;
1893 --sorted_result
1894 SELECT * FROM t1 WHERE a IS NOT NULL;
1895 --sorted_result
1896 SELECT * FROM t1 WHERE a=1 AND b=1;
1897 --sorted_result
1898 SELECT * FROM t1 WHERE a IS NULL AND b=1;
1899 --sorted_result
1900 SELECT * FROM t1 WHERE a IS NOT NULL AND b=1;
1901 DROP TABLE t1;
1902
1903 connection slave;
1904 DROP TABLE t1;
1905
1906 #
1907 # BUG#34788 - malformed federated connection url is not handled correctly -
1908 # crashes server !
1909 #
1910 # also tests
1911 #
1912 # BUG#35509 - Federated leaks memory when connecting to localhost/default
1913 # port
1914 #
1915 CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://';
1916 DROP TABLE t1;
1917
1918
1919 #
1920 # Bug #34779: crash in checksum table on federated tables with blobs
1921 # containing nulls
1922 #
1923 connection slave;
1924 CREATE TABLE t1 (a LONGBLOB, b LONGBLOB);
1925 INSERT INTO t1 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaa', NULL);
1926 connection master;
1927 --replace_result $SLAVE_MYPORT SLAVE_PORT
1928 eval CREATE TABLE t1
1929 (a LONGBLOB, b LONGBLOB) ENGINE=FEDERATED
1930 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/test/t1';
1931 CHECKSUM TABLE t1;
1932 connection slave;
1933 DROP TABLE t1;
1934 connection master;
1935 DROP TABLE t1;
1936
1937
1938 #
1939 # Bug #34774 key prefix on text field in federated tables can cause
1940 # server to crash!
1941 #
1942 connection slave;
1943 CREATE TABLE t1 (a TEXT, b TEXT, KEY(b(1)));
1944 INSERT INTO t1 VALUES (NULL, NULL), (NULL, NULL), (NULL, NULL), (NULL, NULL);
1945 connection master;
1946 --replace_result $SLAVE_MYPORT SLAVE_PORT
1947 eval CREATE TABLE t1
1948 (a TEXT, b TEXT, KEY(b(1))) ENGINE=FEDERATED
1949 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/test/t1';
1950 SELECT t1.a FROM t1, t1 as t2 WHERE t2.b NOT LIKE t1.b;
1951 connection slave;
1952 DROP TABLE t1;
1953 connection master;
1954 DROP TABLE t1;
1955
1956 --echo #
1957 --echo # BUG#21360 - mysqldump error on federated tables
1958 --echo #
1959 connection slave;
1960 --echo #Switch to Connection Slave
1961 CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id));
1962 INSERT INTO t1 VALUES ('text1'),('text2'),('text3'),('text4');
1963
1964 connection master;
1965 --echo #Switch to Connection Master
1966 --replace_result $SLAVE_MYPORT SLAVE_PORT
1967 eval CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id)) ENGINE=FEDERATED
1968 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/test/t1';
1969 --echo # Dump table t1 using mysqldump tool
1970 --replace_result $SLAVE_MYPORT SLAVE_PORT
1971 --exec $MYSQL_DUMP --compact test t1
1972 DROP TABLE t1;
1973
1974 connection slave;
1975 --echo #Switch to Connection Slave
1976 DROP TABLE t1;
1977
1978 connection default;
1979
1980 --echo End of 5.0 tests
1981
1982 create server 's1' foreign data wrapper 'mysql' options (port 3306);
1983 drop server 's1';
1984
1985
1986 --echo #
1987 --echo # Bug #32426: FEDERATED query returns corrupt results for ORDER BY on a TEXT
1988 --echo #
1989 connection slave;
1990 CREATE TABLE federated.t1(a TEXT);
1991 INSERT INTO federated.t1 VALUES('abc'), ('gh'), ('f'), ('ijk'), ('de');
1992
1993 connection master;
1994 --replace_result $SLAVE_MYPORT SLAVE_PORT
1995 eval CREATE TABLE federated.t1(a TEXT) ENGINE=FEDERATED
1996 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
1997 SELECT * FROM federated.t1 ORDER BY A;
1998 SELECT * FROM federated.t1 ORDER BY A DESC;
1999 DROP TABLE federated.t1;
2000
2001 connection slave;
2002 DROP TABLE federated.t1;
2003
2004
2005 --echo End of 5.1 tests
2006
2007 --echo #
2008 --echo # BUG#11751864 - FEDERATED DOESN'T DISTINGUISH BETWEEN DELETE FROM
2009 --echo # T1 AND TRUNCATE T1 NOT NULL NOT SPECIFIED
2010 --echo # BUG#17564775 - FEDERATED DOES NOT SUPPORT DELETE IGNORE
2011
2012 --enable_connect_log
2013 connection master;
2014 CREATE TABLE federated.t1 (a INT PRIMARY KEY, b varchar(64)) ENGINE=InnoDB;
2015 connection slave;
2016 --replace_result $MASTER_MYPORT MASTER_PORT
2017 eval CREATE TABLE federated.t2 (a INT PRIMARY KEY, b varchar(64))
2018 ENGINE=FEDERATED
2019 connection='mysql://[email protected]:$MASTER_MYPORT/federated/t1'
2020 DEFAULT CHARSET=utf8;
2021 connection master;
2022 INSERT INTO federated.t1 VALUES (1,"Larry"), (2,"Curly"), (3,"Moe");
2023 CREATE TABLE federated.t1_child(a int);
2024 ALTER TABLE federated.t1_child ADD CONSTRAINT dc FOREIGN KEY (a) REFERENCES federated.t1(a);
2025 INSERT INTO federated.t1_child VALUES (1), (3);
2026 connection slave;
2027 SELECT * FROM federated.t2;
2028 --echo #We will use the error message returned from server to differentiate between DELETE and TRUNCATE
2029 --error ER_GET_ERRMSG
2030 DELETE FROM federated.t2;
2031 --error ER_GET_ERRMSG
2032 TRUNCATE TABLE federated.t2;
2033 SELECT * FROM federated.t2;
2034 DELETE IGNORE FROM federated.t2;
2035 SELECT * FROM federated.t2;
2036 DELETE IGNORE FROM federated.t2 where a>1;
2037 SELECT * FROM federated.t2;
2038 INSERT INTO federated.t2 VALUES (2,"Curly"),(6,"James");
2039 SELECT * FROM federated.t2;
2040 DELETE IGNORE federated.t2.* FROM federated.t2 where federated.t2.a<5;
2041 SELECT * FROM federated.t2;
2042 DROP TABLE federated.t2;
2043 connection master;
2044 DROP TABLE federated.t1_child;
2045 DROP TABLE federated.t1;
2046 --disable_connect_log
2047
2048 --echo ###
2049 --echo ### Bug#27509959: EXCEPTION NOT CAUGHT W/IN SPROC ADDING A ROW
2050 --echo ### THAT FAILS FK CHECK IN FED TABLE
2051 --echo ###
2052
2053 connection master;
2054
2055 CREATE TABLE federated.parent(a INT, PRIMARY KEY(a)) ENGINE=InnoDB;
2056 CREATE TABLE federated.child(a INT, b INT, PRIMARY KEY(b),FOREIGN KEY(a) REFERENCES federated.parent(a))ENGINE=InnoDB;
2057 INSERT federated.parent VALUES (1);
2058 INSERT federated.child VALUES (1,1);
2059
2060 connection slave;
2061
2062 --replace_result $MASTER_MYPORT MASTER_PORT
2063 eval CREATE TABLE federated.child(a INT, b INT, PRIMARY KEY(b),
2064 FOREIGN KEY(a) REFERENCES federated.parent(a))
2065 ENGINE=FEDERATED
2066 CONNECTION='mysql://[email protected]:$MASTER_MYPORT/federated/child';
2067
2068 SELECT * FROM federated.child;
2069
2070 DROP PROCEDURE IF EXISTS add_child;
2071 DELIMITER |;
2072 CREATE PROCEDURE add_child(IN new_a INT, IN new_b INT)
2073 DETERMINISTIC MODIFIES SQL DATA
2074 BEGIN
2075 DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
2076 BEGIN
2077 GET DIAGNOSTICS @p1 = NUMBER, @p2 = ROW_COUNT;
2078 GET DIAGNOSTICS CONDITION 1 @p3=CLASS_ORIGIN, @p4=SUBCLASS_ORIGIN, @p5=RETURNED_SQLSTATE, @p6=MESSAGE_TEXT, @p7=MYSQL_ERRNO;
2079 SELECT
2080 @p1 as 'NUMBER'
2081 , @p2 as 'ROW_COUNT'
2082 , @p3 as 'CLASS_ORIGIN'
2083 , @p4 as 'SUBCLASS_ORIGIN'
2084 , @p5 as 'RETURNED_SQLSTATE'
2085 , @p6 as 'MESSAGE_TEXT'
2086 , @p7 as 'MYSQL_ERRNO';
2087 END;
2088 INSERT federated.child(a, b) VALUES(new_a, new_b);
2089 END|
2090 DELIMITER ;|
2091
2092 CALL add_child(2,2);
2093 CALL add_child(1,1);
2094
2095 #Cleanup
2096 DROP TABLE federated.child;
2097 DROP PROCEDURE add_child;
2098
2099 connection master;
2100 DROP TABLE federated.child;
2101 DROP TABLE federated.parent;
2102
2103 --echo #
2104 --echo # Bug#11748067: FEDERATED TABLES BLOB FIELD IS NOT CORRECTLY UPDATED
2105 --echo #
2106 connection slave;
2107 CREATE TABLE federated.t1(b BLOB);
2108 INSERT INTO federated.t1 VALUES ('ABC');
2109 connection master;
2110 --replace_result $SLAVE_MYPORT SLAVE_PORT
2111 eval CREATE TABLE federated.t1(b BLOB) ENGINE = FEDERATED
2112 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
2113 SELECT * FROM federated.t1;
2114 UPDATE federated.t1 SET b = 'XYZ';
2115 SELECT * FROM federated.t1;
2116 UPDATE federated.t1 SET b = 'jklm';
2117 SELECT * FROM federated.t1;
2118 UPDATE federated.t1 SET b = NULL;
2119 SELECT * FROM federated.t1;
2120 UPDATE federated.t1 SET b = 'abc';
2121 SELECT * FROM federated.t1;
2122 UPDATE federated.t1 SET b = '';
2123 SELECT * FROM federated.t1;
2124 DROP TABLE federated.t1;
2125 connection slave;
2126 DROP TABLE federated.t1;
2127
2128 --echo #
2129 --echo # Bug#28877215 CANNOT CREATE A JSON VALUE FROM A STRING WITH CHARACTER SET 'BINARY'
2130 --echo #
2131 connection slave;
2132 CREATE TABLE federated.t1(a JSON, b INT);
2133 INSERT INTO federated.t1 VALUES ('{}', 1);
2134
2135 connection master;
2136 --replace_result $SLAVE_MYPORT SLAVE_PORT
2137 eval CREATE TABLE federated.t1(a JSON, b INT) ENGINE=FEDERATED
2138 CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1';
2139 SELECT a, b FROM federated.t1;
2140 UPDATE federated.t1 SET a = '[1]';
2141 SELECT a, b FROM federated.t1;
2142
2143 UPDATE federated.t1 SET a = '[1, 2]' WHERE b = 1;
2144 SELECT a, b FROM federated.t1;
2145
2146 DELETE FROM federated.t1 WHERE b = 1;
2147 SELECT a, b FROM federated.t1;
2148
2149 DROP TABLE federated.t1;
2150
2151 connection slave;
2152 DROP TABLE federated.t1;
2153
2154 connection default;
2155 SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
2156 connection slave;
2157 SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
2158
2159 connection default;
2160 source suite/federated/include/federated_cleanup.inc;