| 1 |
# BUG#47312: RBR: Disabling key on slave breaks replication: |
| 2 |
# HA_ERR_WRONG_INDEX |
| 3 |
# |
| 4 |
# Description |
| 5 |
# =========== |
| 6 |
# |
| 7 |
# Case #1, shows that before patch for BUG#47312, if defining key on |
| 8 |
# slave table, and later disable it, replication would break. This |
| 9 |
# has been fixed. |
| 10 |
# |
| 11 |
|
| 12 |
-- source include/not_group_replication_plugin.inc |
| 13 |
-- source include/have_binlog_format_row.inc |
| 14 |
-- source include/force_myisam_default.inc |
| 15 |
-- source include/have_myisam.inc |
| 16 |
-- source include/master-slave.inc |
| 17 |
|
| 18 |
# |
| 19 |
# Case #1: master has key, slave also has one, |
| 20 |
# but it gets disabled sometime. |
| 21 |
# Replication does not break anymore. |
| 22 |
# |
| 23 |
--source include/rpl_reset.inc |
| 24 |
-- connection master |
| 25 |
|
| 26 |
CREATE TABLE t (a int, b int, c int, key(b)) ENGINE=MyISAM; |
| 27 |
|
| 28 |
--source include/sync_slave_sql_with_master.inc |
| 29 |
|
| 30 |
ALTER TABLE t DISABLE KEYS; |
| 31 |
|
| 32 |
-- connection master |
| 33 |
|
| 34 |
INSERT INTO t VALUES (1,2,4); |
| 35 |
INSERT INTO t VALUES (4,3,4); |
| 36 |
DELETE FROM t; |
| 37 |
|
| 38 |
--source include/sync_slave_sql_with_master.inc |
| 39 |
|
| 40 |
-- connection master |
| 41 |
DROP TABLE t; |
| 42 |
|
| 43 |
--source include/sync_slave_sql_with_master.inc |
| 44 |
|
| 45 |
# |
| 46 |
# BUG#53889: slaves stops with 1032; handler error HA_ERR_KEY_NOT_FOUND |
| 47 |
# |
| 48 |
-- source include/rpl_reset.inc |
| 49 |
-- connection master |
| 50 |
|
| 51 |
CREATE TABLE t2 (col4 CHAR(25) DEFAULT NULL, |
| 52 |
col1 BIGINT, |
| 53 |
col2 TINYINT NOT NULL, |
| 54 |
col5 VARCHAR(25) DEFAULT '' |
| 55 |
) ENGINE = myisam; |
| 56 |
|
| 57 |
ALTER TABLE t2 ADD INDEX idx1 ( col4 ) , ADD UNIQUE INDEX idx2 ( col5 ); |
| 58 |
INSERT INTO t2 ( col4 , col2 ) VALUES ( 'Hello', -77 ) ; |
| 59 |
UPDATE t2 SET col1 = 13 WHERE col2 = -77; |
| 60 |
--source include/sync_slave_sql_with_master.inc |
| 61 |
|
| 62 |
-- let $diff_tables= master:t2, slave:t2 |
| 63 |
-- source include/diff_tables.inc |
| 64 |
|
| 65 |
-- connection master |
| 66 |
DROP TABLE t2; |
| 67 |
--source include/sync_slave_sql_with_master.inc |
| 68 |
|
| 69 |
--source include/rpl_end.inc |
| 70 |
|