~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/extra/rpl_tests/rpl_row_basic.test

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
259
259
query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
260
260
sync_slave_with_master;
261
261
set @@global.slave_exec_mode= default;
262
 
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
 
262
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
263
263
disable_query_log;
264
264
eval SELECT "$last_error" AS Last_SQL_Error;
265
265
enable_query_log;
266
266
query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
267
267
 
 
268
# BUG#37076: TIMESTAMP/DATETIME values are not replicated correctly
 
269
#            between machines with mixed endiannes
 
270
#            (regression test)
 
271
 
 
272
--echo **** Test for BUG#37076 ****
 
273
--echo **** On Master ****
 
274
connection master;
 
275
DROP TABLE IF EXISTS t1;
 
276
CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE);
 
277
INSERT INTO t1 VALUES(
 
278
  '2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14');
 
279
 
 
280
--echo **** On Slave ****
 
281
sync_slave_with_master slave;
 
282
SELECT * FROM t1;
 
283
 
268
284
#
269
285
# cleanup
270
286
#
272
288
connection master;
273
289
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
274
290
sync_slave_with_master;
 
291
 
 
292
#
 
293
# BUG#37426: RBR breaks for CHAR() UTF8 fields > 85 chars
 
294
#
 
295
 
 
296
# We have 4 combinations to test with respect to the field length
 
297
# (i.e., the number of bytes) of the CHAR fields:
 
298
#
 
299
# 1. Replicating from CHAR<256 to CHAR<256 
 
300
# 2. Replicating from CHAR<256 to CHAR>255
 
301
# 3. Replicating from CHAR>255 to CHAR<256
 
302
# 4. Replicating from CHAR>255 to CHAR>255
 
303
 
 
304
# We also make a special case of using the max size of a field on the
 
305
# master, i.e. CHAR(255) in UTF-8, giving another three cases.
 
306
#
 
307
# 5. Replicating UTF-8 CHAR(255) to CHAR(<256)
 
308
# 6. Replicating UTF-8 CHAR(255) to CHAR(>255)
 
309
# 7. Replicating UTF-8 CHAR(255) to CHAR(255) UTF-8
 
310
 
 
311
connection master;
 
312
CREATE TABLE t1 (i INT NOT NULL,
 
313
                 c CHAR(16) CHARACTER SET utf8 NOT NULL,
 
314
                 j INT NOT NULL);
 
315
 
 
316
CREATE TABLE t2 (i INT NOT NULL,
 
317
                 c CHAR(16) CHARACTER SET utf8 NOT NULL,
 
318
                 j INT NOT NULL);
 
319
 
 
320
sync_slave_with_master;
 
321
ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
 
322
 
 
323
connection master;
 
324
CREATE TABLE t3 (i INT NOT NULL,
 
325
                 c CHAR(128) CHARACTER SET utf8 NOT NULL,
 
326
                 j INT NOT NULL);
 
327
sync_slave_with_master;
 
328
ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
 
329
 
 
330
connection master;
 
331
CREATE TABLE t4 (i INT NOT NULL,
 
332
                 c CHAR(128) CHARACTER SET utf8 NOT NULL,
 
333
                 j INT NOT NULL);
 
334
 
 
335
CREATE TABLE t5 (i INT NOT NULL,
 
336
                 c CHAR(255) CHARACTER SET utf8 NOT NULL,
 
337
                 j INT NOT NULL);
 
338
sync_slave_with_master;
 
339
ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
 
340
 
 
341
connection master;
 
342
CREATE TABLE t6 (i INT NOT NULL,
 
343
                 c CHAR(255) CHARACTER SET utf8 NOT NULL,
 
344
                 j INT NOT NULL);
 
345
sync_slave_with_master;
 
346
ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
 
347
 
 
348
connection master;
 
349
CREATE TABLE t7 (i INT NOT NULL,
 
350
                 c CHAR(255) CHARACTER SET utf8 NOT NULL,
 
351
                 j INT NOT NULL);
 
352
 
 
353
--echo [expecting slave to replicate correctly]
 
354
connection master;
 
355
INSERT INTO t1 VALUES (1, "", 1);
 
356
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
 
357
 
 
358
let $diff_table_1=master:test.t1;
 
359
let $diff_table_2=slave:test.t1;
 
360
source include/diff_tables.inc;
 
361
 
 
362
--echo [expecting slave to replicate correctly]
 
363
connection master;
 
364
INSERT INTO t2 VALUES (1, "", 1);
 
365
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
 
366
 
 
367
let $diff_table_1=master:test.t2;
 
368
let $diff_table_2=slave:test.t2;
 
369
source include/diff_tables.inc;
 
370
 
 
371
--echo [expecting slave to stop]
 
372
connection master;
 
373
INSERT INTO t3 VALUES (1, "", 1);
 
374
INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
 
375
 
 
376
connection slave;
 
377
source include/wait_for_slave_sql_to_stop.inc;
 
378
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
 
379
disable_query_log;
 
380
eval SELECT "$last_error" AS Last_SQL_Error;
 
381
enable_query_log;
 
382
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
 
383
START SLAVE;
 
384
source include/wait_for_slave_to_start.inc;
 
385
 
 
386
--echo [expecting slave to replicate correctly]
 
387
connection master;
 
388
INSERT INTO t4 VALUES (1, "", 1);
 
389
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
 
390
 
 
391
let $diff_table_1=master:test.t4;
 
392
let $diff_table_2=slave:test.t4;
 
393
source include/diff_tables.inc;
 
394
 
 
395
--echo [expecting slave to stop]
 
396
connection master;
 
397
INSERT INTO t5 VALUES (1, "", 1);
 
398
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
 
399
 
 
400
connection slave;
 
401
source include/wait_for_slave_sql_to_stop.inc;
 
402
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
 
403
disable_query_log;
 
404
eval SELECT "$last_error" AS Last_SQL_Error;
 
405
enable_query_log;
 
406
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
 
407
START SLAVE;
 
408
source include/wait_for_slave_to_start.inc;
 
409
 
 
410
--echo [expecting slave to stop]
 
411
connection master;
 
412
INSERT INTO t6 VALUES (1, "", 1);
 
413
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
 
414
 
 
415
connection slave;
 
416
source include/wait_for_slave_sql_to_stop.inc;
 
417
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
 
418
disable_query_log;
 
419
eval SELECT "$last_error" AS Last_SQL_Error;
 
420
enable_query_log;
 
421
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
 
422
START SLAVE;
 
423
source include/wait_for_slave_to_start.inc;
 
424
 
 
425
--echo [expecting slave to replicate correctly]
 
426
connection master;
 
427
INSERT INTO t7 VALUES (1, "", 1);
 
428
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
 
429
 
 
430
let $diff_table_1=master:test.t7;
 
431
let $diff_table_2=slave:test.t7;
 
432
source include/diff_tables.inc;
 
433
 
 
434
connection master;
 
435
drop table t1, t2, t3, t4, t5, t6, t7;
 
436
sync_slave_with_master;
 
437