You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.0 KiB

  1. include/rpl_init.inc [topology=1->2]
  2. *** Test normal shutdown/restart of slave server configured as a GTID slave. ***
  3. CREATE TABLE t1 (a INT PRIMARY KEY);
  4. INSERT INTO t1 VALUES (1);
  5. include/stop_slave.inc
  6. Master_Log_File = 'master-bin.000001'
  7. Using_Gtid = 'No'
  8. CHANGE MASTER TO master_use_gtid=current_pos;
  9. FLUSH LOGS;
  10. include/wait_for_purge.inc "master-bin.000002"
  11. show binary logs;
  12. Log_name File_size
  13. master-bin.000002 #
  14. INSERT INTO t1 VALUES (2);
  15. FLUSH LOGS;
  16. INSERT INTO t1 VALUES (3);
  17. show binary logs;
  18. Log_name File_size
  19. master-bin.000002 #
  20. master-bin.000003 #
  21. SELECT * FROM t1 ORDER BY a;
  22. a
  23. 1
  24. 2
  25. 3
  26. *** Test normal shutdown/restart of master server, check binlog state is preserved. ***
  27. SET SESSION gtid_domain_id= 1;
  28. INSERT INTO t1 VALUES (4);
  29. SHOW BINLOG EVENTS IN 'master-bin.000003' LIMIT 1,1;
  30. Log_name Pos Event_type Server_id End_log_pos Info
  31. master-bin.000003 # Gtid_list # # [0-1-3]
  32. FLUSH LOGS;
  33. SHOW BINLOG EVENTS IN 'master-bin.000004' LIMIT 1,1;
  34. Log_name Pos Event_type Server_id End_log_pos Info
  35. master-bin.000004 # Gtid_list # # [1-1-1,0-1-4]
  36. SHOW BINLOG EVENTS IN 'master-bin.000005' LIMIT 1,1;
  37. Log_name Pos Event_type Server_id End_log_pos Info
  38. master-bin.000005 # Gtid_list # # [1-1-1,0-1-4]
  39. show binary logs;
  40. Log_name File_size
  41. master-bin.000002 #
  42. master-bin.000003 #
  43. master-bin.000004 #
  44. master-bin.000005 #
  45. INSERT INTO t1 VALUES(5);
  46. SELECT * FROM t1 ORDER BY a;
  47. a
  48. 1
  49. 2
  50. 3
  51. 4
  52. 5
  53. *** Test that @@gtid_slave_pos and @@gtid_current_pos are correctly loaded even if slave threads have not started. ***
  54. SET @slave_pos2= @@GLOBAL.gtid_slave_pos;
  55. SET @current_pos2= @@GLOBAL.gtid_current_pos;
  56. SELECT IF(@slave_pos1=@slave_pos2, "OK", CONCAT(@slave_pos1, " != ", @slave_pos2));
  57. IF(@slave_pos1=@slave_pos2, "OK", CONCAT(@slave_pos1, " != ", @slave_pos2))
  58. OK
  59. SELECT IF(@current_pos1=@current_pos2, "OK", CONCAT(@current_pos1, " != ", @current_pos2));
  60. IF(@current_pos1=@current_pos2, "OK", CONCAT(@current_pos1, " != ", @current_pos2))
  61. OK
  62. include/start_slave.inc
  63. DROP TABLE t1;
  64. include/rpl_end.inc