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.

52 lines
1.4 KiB

Bug#13693012: SLAVE CRASHING ON INSERT STATEMENT WITH MERGE TABLE PROBLEM: After WL 4144, when using MyISAM Merge tables, the routine open_and_lock_tables will append to the list of tables to lock, the base tables that make up the MERGE table. This has two side-effects in replication: 1. On the master side, we log additional table maps for the base tables, since they appear in the list of locked tables, even though we don't really use them at the slave. 2. On the slave side, when opening a MERGE table while applying a ROW event, additional tables are appended to the list of tables to lock. Side-effect #1 is not harmful. It's just that when using MyISAM Merge tables a few table maps more may be logged. Side-effect #2, is harmful, because the list rli->tables_to_lock is an extended structure from TABLE_LIST in which the extra fields are filled from the table maps that are processed. Since open_and_lock_tables appends tables to the list after all table map events have been processed we end up with entries without replication/table map data on them. Thus when trying to access that info for these extra tables, the server will crash. SOLUTION: We fix side-effect #2 by making sure that we access the replication part of the structure for those in the list that were accounted for when processing the correspondent table map events. All in all, we never go beyond rli->tables_to_lock_count. We also deploy an assertion when clearing rli->tables_to_lock, making sure that the base tables are not in the list anymore (were closed in close_thread_tables).
14 years ago
Bug#13693012: SLAVE CRASHING ON INSERT STATEMENT WITH MERGE TABLE PROBLEM: After WL 4144, when using MyISAM Merge tables, the routine open_and_lock_tables will append to the list of tables to lock, the base tables that make up the MERGE table. This has two side-effects in replication: 1. On the master side, we log additional table maps for the base tables, since they appear in the list of locked tables, even though we don't really use them at the slave. 2. On the slave side, when opening a MERGE table while applying a ROW event, additional tables are appended to the list of tables to lock. Side-effect #1 is not harmful. It's just that when using MyISAM Merge tables a few table maps more may be logged. Side-effect #2, is harmful, because the list rli->tables_to_lock is an extended structure from TABLE_LIST in which the extra fields are filled from the table maps that are processed. Since open_and_lock_tables appends tables to the list after all table map events have been processed we end up with entries without replication/table map data on them. Thus when trying to access that info for these extra tables, the server will crash. SOLUTION: We fix side-effect #2 by making sure that we access the replication part of the structure for those in the list that were accounted for when processing the correspondent table map events. All in all, we never go beyond rli->tables_to_lock_count. We also deploy an assertion when clearing rli->tables_to_lock, making sure that the base tables are not in the list anymore (were closed in close_thread_tables).
14 years ago
  1. #
  2. # BUG#47103
  3. #
  4. # This test case checks whether the slave crashes or not when there is
  5. # a merge table in use.
  6. #
  7. # Description
  8. # ===========
  9. #
  10. # The test case creates two regular MyISAM tables on the master and
  11. # one MERGE table. Then it populates the MyISAM tables, updates and
  12. # deletes their contents through the merge table. Finally, the slave
  13. # is synchronized with the master and (after the fix) it won't crash.
  14. #
  15. --source include/master-slave.inc
  16. --source include/have_binlog_format_row.inc
  17. --connection master
  18. CREATE TABLE t1 (a int) ENGINE=MyISAM;
  19. CREATE TABLE t2 (a int) ENGINE=MyISAM;
  20. INSERT INTO t1 VALUES (1), (2), (3);
  21. INSERT INTO t2 VALUES (4), (5), (6);
  22. # Changed a little to check also an issue reported on BUG#20574550
  23. CREATE TEMPORARY TABLE IF NOT EXISTS tt1_merge LIKE t1;
  24. ALTER TABLE tt1_merge ENGINE=MERGE UNION (t2, t1);
  25. CREATE TABLE t1_merge LIKE tt1_merge;
  26. --sync_slave_with_master
  27. --let diff_tables=master:test.t1, slave:test.t1
  28. --source include/diff_tables.inc
  29. --let diff_tables=master:test.t2, slave:test.t2
  30. --source include/diff_tables.inc
  31. --connection master
  32. UPDATE t1_merge SET a=10 WHERE a=1;
  33. DELETE FROM t1_merge WHERE a=10;
  34. --sync_slave_with_master
  35. --connection master
  36. --let diff_tables=master:test.t1, slave:test.t1
  37. --source include/diff_tables.inc
  38. --let diff_tables=master:test.t2, slave:test.t2
  39. --source include/diff_tables.inc
  40. DROP TABLE t1_merge, t1, t2;
  41. --sync_slave_with_master
  42. --source include/rpl_end.inc