| 1 |
include/master-slave.inc |
| 2 |
Warnings: |
| 3 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 4 |
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. |
| 5 |
[connection master] |
| 6 |
CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); |
| 7 |
CALL mtr.add_suppression("Error dropping database"); |
| 8 |
CALL mtr.add_suppression("Can't drop database '.*'; database doesn't exist"); |
| 9 |
CALL mtr.add_suppression("Replica SQL for channel '': ... The replica coordinator and worker threads are stopped, possibly leaving data in inconsistent state. .* Error_code: MY-001756"); |
| 10 |
CALL mtr.add_suppression("Replica SQL for channel '': .* Error_code: MY-001105"); |
| 11 |
==== Case 2: DROP TABLES ==== |
| 12 |
==== Case 2D: Failing DROP TABLES for base tables with and without atomic DDL support ==== |
| 13 |
CREATE TABLE base_1_n (a INT) ENGINE = MyISAM; |
| 14 |
CREATE TABLE base_2_n (a INT) ENGINE = MyISAM; |
| 15 |
CREATE TABLE base_3_a (a INT) ENGINE = InnoDB; |
| 16 |
CREATE TABLE base_4_a (pk INT PRIMARY KEY) ENGINE = InnoDB; |
| 17 |
include/rpl_sync.inc |
| 18 |
---- GTID_MODE=AUTOMATIC ---- |
| 19 |
include/gtid_step_reset.inc |
| 20 |
SET SESSION DEBUG='+d,rm_table_no_locks_abort_after_atomic_tables'; |
| 21 |
DROP TABLES base_1_n, base_2_n, base_3_a, base_4_a; |
| 22 |
ERROR HY000: Unknown error |
| 23 |
SET SESSION DEBUG='-d,rm_table_no_locks_abort_after_atomic_tables'; |
| 24 |
# In AUTOMATIC mode the above statement should be split into |
| 25 |
# two statements for each of MyISAM tables. |
| 26 |
# There should be no statement for dropping base_3_a or |
| 27 |
# base_4_a as their removal is rolled back. |
| 28 |
include/gtid_step_assert.inc [count=2., only_count=0] |
| 29 |
# base_3_a and base_4_a should still be there on master |
| 30 |
SHOW CREATE TABLE base_3_a; |
| 31 |
Table Create Table |
| 32 |
base_3_a CREATE TABLE `base_3_a` ( |
| 33 |
`a` int DEFAULT NULL |
| 34 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 35 |
SHOW CREATE TABLE base_4_a; |
| 36 |
Table Create Table |
| 37 |
base_4_a CREATE TABLE `base_4_a` ( |
| 38 |
`pk` int NOT NULL, |
| 39 |
PRIMARY KEY (`pk`) |
| 40 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 41 |
include/rpl_sync.inc |
| 42 |
# base_3_a and base_4_a should still be there on slave |
| 43 |
SHOW CREATE TABLE base_3_a; |
| 44 |
Table Create Table |
| 45 |
base_3_a CREATE TABLE `base_3_a` ( |
| 46 |
`a` int DEFAULT NULL |
| 47 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 48 |
SHOW CREATE TABLE base_4_a; |
| 49 |
Table Create Table |
| 50 |
base_4_a CREATE TABLE `base_4_a` ( |
| 51 |
`pk` int NOT NULL, |
| 52 |
PRIMARY KEY (`pk`) |
| 53 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 54 |
CREATE TABLE base_1_n (a INT) ENGINE = MyISAM; |
| 55 |
CREATE TABLE base_2_n (a INT) ENGINE = MyISAM; |
| 56 |
include/rpl_sync.inc |
| 57 |
---- GTID_NEXT=non-automatic ---- |
| 58 |
include/gtid_step_reset.inc |
| 59 |
SET GTID_NEXT = '#'; |
| 60 |
SET SESSION DEBUG='+d,rm_table_no_locks_abort_after_atomic_tables'; |
| 61 |
DROP TABLES base_1_n, base_2_n, base_3_a, base_4_a; |
| 62 |
ERROR HY000: Unknown error |
| 63 |
SET SESSION DEBUG='-d,rm_table_no_locks_abort_after_atomic_tables'; |
| 64 |
SET GTID_NEXT= 'AUTOMATIC'; |
| 65 |
# Without GTID assigned the above statement should be split into |
| 66 |
# two as in AUTOMATIC mode. |
| 67 |
include/gtid_step_assert.inc [count=2, only_count=0] |
| 68 |
# base_3_a and base_4_a should still be there on master |
| 69 |
SHOW CREATE TABLE base_3_a; |
| 70 |
Table Create Table |
| 71 |
base_3_a CREATE TABLE `base_3_a` ( |
| 72 |
`a` int DEFAULT NULL |
| 73 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 74 |
SHOW CREATE TABLE base_4_a; |
| 75 |
Table Create Table |
| 76 |
base_4_a CREATE TABLE `base_4_a` ( |
| 77 |
`pk` int NOT NULL, |
| 78 |
PRIMARY KEY (`pk`) |
| 79 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 80 |
include/rpl_sync.inc |
| 81 |
# base_3_a and base_4_a should still be there on slave |
| 82 |
SHOW CREATE TABLE base_3_a; |
| 83 |
Table Create Table |
| 84 |
base_3_a CREATE TABLE `base_3_a` ( |
| 85 |
`a` int DEFAULT NULL |
| 86 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 87 |
SHOW CREATE TABLE base_4_a; |
| 88 |
Table Create Table |
| 89 |
base_4_a CREATE TABLE `base_4_a` ( |
| 90 |
`pk` int NOT NULL, |
| 91 |
PRIMARY KEY (`pk`) |
| 92 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 93 |
---- Clean up ---- |
| 94 |
DROP TABLE base_4_a, base_3_a; |
| 95 |
include/rpl_sync.inc |
| 96 |
==== Case 3: DROP DATABASE ==== |
| 97 |
---- Initialize ---- |
| 98 |
# db1, db2, db3: no tables. |
| 99 |
CREATE DATABASE db1; |
| 100 |
CREATE DATABASE db2; |
| 101 |
CREATE DATABASE db3; |
| 102 |
include/rpl_sync.inc |
| 103 |
# db4, db5, db6: one table. |
| 104 |
CREATE DATABASE db4; |
| 105 |
CREATE DATABASE db5; |
| 106 |
CREATE DATABASE db6; |
| 107 |
CREATE TABLE db4.t1 (a INT); |
| 108 |
CREATE TABLE db5.t1 (a INT); |
| 109 |
CREATE TABLE db6.t1 (a INT); |
| 110 |
include/rpl_sync.inc |
| 111 |
# db7, db8, db9: one MyISAM and one InnoDB table. |
| 112 |
CREATE DATABASE db7; |
| 113 |
CREATE DATABASE db8; |
| 114 |
CREATE DATABASE db9; |
| 115 |
CREATE TABLE db7.t1 (a INT) ENGINE=InnoDB; |
| 116 |
CREATE TABLE db8.t1 (a INT) ENGINE=InnoDB; |
| 117 |
CREATE TABLE db9.t1 (a INT) ENGINE=InnoDB; |
| 118 |
CREATE TABLE db7.t2 (a INT) ENGINE=MyISAM; |
| 119 |
CREATE TABLE db8.t2 (a INT) ENGINE=MyISAM; |
| 120 |
CREATE TABLE db9.t2 (a INT) ENGINE=MyISAM; |
| 121 |
include/rpl_sync.inc |
| 122 |
# db10, db11, db12: two MyISAM and one InnoDB table. |
| 123 |
CREATE DATABASE db10; |
| 124 |
CREATE DATABASE db11; |
| 125 |
CREATE DATABASE db12; |
| 126 |
CREATE TABLE db10.t1 (a INT) ENGINE=MyISAM; |
| 127 |
CREATE TABLE db11.t1 (a INT) ENGINE=MyISAM; |
| 128 |
CREATE TABLE db12.t1 (a INT) ENGINE=MyISAM; |
| 129 |
CREATE TABLE db10.t2 (a INT) ENGINE=MyISAM; |
| 130 |
CREATE TABLE db11.t2 (a INT) ENGINE=MyISAM; |
| 131 |
CREATE TABLE db12.t2 (a INT) ENGINE=MyISAM; |
| 132 |
CREATE TABLE db10.t3 (a INT) ENGINE=InnoDB; |
| 133 |
CREATE TABLE db11.t3 (a INT) ENGINE=InnoDB; |
| 134 |
CREATE TABLE db12.t3 (a INT) ENGINE=InnoDB; |
| 135 |
include/rpl_sync.inc |
| 136 |
# db13, db14: not a database, but the directory and the entry exist. |
| 137 |
# db15 is not a database, but the empty directory exists on master. |
| 138 |
include/rpl_sync.inc |
| 139 |
# db19, db20: one MyISAM and one InnoDB table (successfull case). |
| 140 |
CREATE DATABASE db19; |
| 141 |
CREATE DATABASE db20; |
| 142 |
CREATE TABLE db19.t1 (a INT) ENGINE=InnoDB; |
| 143 |
CREATE TABLE db20.t1 (a INT) ENGINE=InnoDB; |
| 144 |
CREATE TABLE db19.t2 (a INT) ENGINE=MyISAM; |
| 145 |
CREATE TABLE db20.t2 (a INT) ENGINE=MyISAM; |
| 146 |
include/rpl_sync.inc |
| 147 |
---- DROP DATABASE is split on master; GTID_NEXT=AUTOMATIC ---- |
| 148 |
# db1: no table. |
| 149 |
include/save_binlog_position.inc |
| 150 |
SET GTID_NEXT = 'AUTOMATIC'; |
| 151 |
SET DEBUG= '+d, rm_db_fail_after_dropping_tables'; |
| 152 |
DROP DATABASE db1; |
| 153 |
ERROR HY000: Unknown error |
| 154 |
SET DEBUG= '-d, rm_db_fail_after_dropping_tables'; |
| 155 |
include/assert_binlog_events.inc [()] |
| 156 |
# db4: one InnoDB table. |
| 157 |
include/save_binlog_position.inc |
| 158 |
SET GTID_NEXT = 'AUTOMATIC'; |
| 159 |
SET DEBUG= '+d, rm_db_fail_after_dropping_tables'; |
| 160 |
DROP DATABASE db4; |
| 161 |
ERROR HY000: Unknown error |
| 162 |
SET DEBUG= '-d, rm_db_fail_after_dropping_tables'; |
| 163 |
include/assert_binlog_events.inc [()] |
| 164 |
# db7: one MyISAM and one InnoDB table. |
| 165 |
include/save_binlog_position.inc |
| 166 |
SET GTID_NEXT = 'AUTOMATIC'; |
| 167 |
SET DEBUG= '+d, rm_db_fail_after_dropping_tables'; |
| 168 |
DROP DATABASE db7; |
| 169 |
ERROR HY000: Unknown error |
| 170 |
SET DEBUG= '-d, rm_db_fail_after_dropping_tables'; |
| 171 |
include/assert_binlog_events.inc [Anonymous_Gtid # !Q(DROP TABLE.*)] |
| 172 |
# db10: two MyISAM and one InnoDB table. |
| 173 |
include/save_binlog_position.inc |
| 174 |
SET GTID_NEXT = 'AUTOMATIC'; |
| 175 |
SET DEBUG= '+d, rm_db_fail_after_dropping_tables'; |
| 176 |
DROP DATABASE db10; |
| 177 |
ERROR HY000: Unknown error |
| 178 |
SET DEBUG= '-d, rm_db_fail_after_dropping_tables'; |
| 179 |
include/assert_binlog_events.inc [Anonymous_Gtid # !Q(DROP TABLE.*) # Anonymous_Gtid # !Q(DROP TABLE.*)] |
| 180 |
# db13: not a database, but directory exists. |
| 181 |
include/save_binlog_position.inc |
| 182 |
SET GTID_NEXT = 'AUTOMATIC'; |
| 183 |
DROP DATABASE db13; |
| 184 |
ERROR HY000: Schema 'db13' does not exist, but schema directory './db13/' was found. This must be resolved manually (e.g. by moving the schema directory to another location). |
| 185 |
include/assert_binlog_events.inc [()] |
| 186 |
# db16: not a database. |
| 187 |
include/save_binlog_position.inc |
| 188 |
SET GTID_NEXT = 'AUTOMATIC'; |
| 189 |
DROP DATABASE db16; |
| 190 |
ERROR HY000: Can't drop database 'db16'; database doesn't exist |
| 191 |
include/assert_binlog_events.inc [()] |
| 192 |
# db19: Successfull DROP DATABASE for one MyISAM and one InnoDB table. |
| 193 |
include/save_binlog_position.inc |
| 194 |
SET GTID_NEXT = 'AUTOMATIC'; |
| 195 |
DROP DATABASE db19; |
| 196 |
include/assert_binlog_events.inc [Anonymous_Gtid # !Q(DROP TABLE.*) # Anonymous_Gtid # !Q(DROP DATABASE.*)] |
| 197 |
---- DROP DATABASE is split on master; GTID_NEXT=non-automatic ---- |
| 198 |
# db2: no table. |
| 199 |
include/save_binlog_position.inc |
| 200 |
SET GTID_NEXT = '#'; |
| 201 |
SET DEBUG= '+d, rm_db_fail_after_dropping_tables'; |
| 202 |
DROP DATABASE db2; |
| 203 |
ERROR HY000: Unknown error |
| 204 |
SET DEBUG= '-d, rm_db_fail_after_dropping_tables'; |
| 205 |
include/assert_binlog_events.inc [()] |
| 206 |
SET GTID_NEXT = 'AUTOMATIC'; |
| 207 |
# db5: one InnoDB table. |
| 208 |
include/save_binlog_position.inc |
| 209 |
SET GTID_NEXT = '#'; |
| 210 |
SET DEBUG= '+d, rm_db_fail_after_dropping_tables'; |
| 211 |
DROP DATABASE db5; |
| 212 |
ERROR HY000: Unknown error |
| 213 |
SET DEBUG= '-d, rm_db_fail_after_dropping_tables'; |
| 214 |
include/assert_binlog_events.inc [()] |
| 215 |
SET GTID_NEXT = 'AUTOMATIC'; |
| 216 |
# db8: one MyISAM and one InnoDB table. |
| 217 |
include/save_binlog_position.inc |
| 218 |
SET GTID_NEXT = '#'; |
| 219 |
SET DEBUG= '+d, rm_db_fail_after_dropping_tables'; |
| 220 |
DROP DATABASE db8; |
| 221 |
ERROR HY000: Unknown error |
| 222 |
SET DEBUG= '-d, rm_db_fail_after_dropping_tables'; |
| 223 |
include/assert_binlog_events.inc [Anonymous_Gtid # !Q(DROP TABLE.*)] |
| 224 |
SET GTID_NEXT = 'AUTOMATIC'; |
| 225 |
# db11: two MyISAM and one InnoDB tables. |
| 226 |
include/save_binlog_position.inc |
| 227 |
SET GTID_NEXT = '#'; |
| 228 |
SET DEBUG= '+d, rm_db_fail_after_dropping_tables'; |
| 229 |
DROP DATABASE db11; |
| 230 |
ERROR HY000: Unknown error |
| 231 |
SET DEBUG= '-d, rm_db_fail_after_dropping_tables'; |
| 232 |
include/assert_binlog_events.inc [Anonymous_Gtid # !Q(DROP TABLE.*) # Anonymous_Gtid # !Q(DROP TABLE.*)] |
| 233 |
SET GTID_NEXT = 'AUTOMATIC'; |
| 234 |
# db14: not a database, but directory exists. |
| 235 |
include/save_binlog_position.inc |
| 236 |
SET GTID_NEXT = '#'; |
| 237 |
DROP DATABASE db14; |
| 238 |
ERROR HY000: Schema 'db14' does not exist, but schema directory './db14/' was found. This must be resolved manually (e.g. by moving the schema directory to another location). |
| 239 |
include/assert_binlog_events.inc [()] |
| 240 |
SET GTID_NEXT = 'AUTOMATIC'; |
| 241 |
# db17: not a database. |
| 242 |
include/save_binlog_position.inc |
| 243 |
SET GTID_NEXT = '#'; |
| 244 |
DROP DATABASE db17; |
| 245 |
ERROR HY000: Can't drop database 'db17'; database doesn't exist |
| 246 |
include/assert_binlog_events.inc [()] |
| 247 |
SET GTID_NEXT = 'AUTOMATIC'; |
| 248 |
# db20: Successfull DROP DATABASE for one MyISAM and one InnoDB table. |
| 249 |
# No splitting if GTID is assigned. |
| 250 |
include/save_binlog_position.inc |
| 251 |
SET GTID_NEXT = '#'; |
| 252 |
DROP DATABASE db20; |
| 253 |
include/assert_binlog_events.inc [Anonymous_Gtid # !Q(DROP TABLE.*) # Anonymous_Gtid # !Q(DROP DATABASE.*)] |
| 254 |
SET GTID_NEXT = 'AUTOMATIC'; |
| 255 |
include/rpl_sync.inc |
| 256 |
---- DROP DATABASE is split on slave ---- |
| 257 |
SET GTID_NEXT = 'AUTOMATIC'; |
| 258 |
SET GLOBAL DEBUG= '+d, rm_db_fail_after_dropping_tables'; |
| 259 |
[connection master] |
| 260 |
# db3: no table. |
| 261 |
DROP DATABASE db3; |
| 262 |
include/sync_slave_io_with_master.inc |
| 263 |
include/wait_for_slave_sql_error.inc [errno=1105] |
| 264 |
include/include/rpl_skip_to_end_of_relay_log.inc |
| 265 |
[connection master] |
| 266 |
# db6: one InnoDB table. |
| 267 |
DROP DATABASE db6; |
| 268 |
include/sync_slave_io_with_master.inc |
| 269 |
include/wait_for_slave_sql_error.inc [errno=1105] |
| 270 |
include/include/rpl_skip_to_end_of_relay_log.inc |
| 271 |
[connection master] |
| 272 |
# db9: one MyISAM and one InnoDB table. |
| 273 |
DROP DATABASE db9; |
| 274 |
include/sync_slave_io_with_master.inc |
| 275 |
include/wait_for_slave_sql_error.inc [errno=1105] |
| 276 |
include/include/rpl_skip_to_end_of_relay_log.inc |
| 277 |
[connection master] |
| 278 |
# db12: two MyISAM and one InnoDB table. |
| 279 |
DROP DATABASE db12; |
| 280 |
include/sync_slave_io_with_master.inc |
| 281 |
include/wait_for_slave_sql_error.inc [errno=1105] |
| 282 |
include/include/rpl_skip_to_end_of_relay_log.inc |
| 283 |
SET GLOBAL DEBUG= '-d, rm_db_fail_after_dropping_tables'; |
| 284 |
[connection master] |
| 285 |
# db15: not a database, but an empty directory exists. |
| 286 |
DROP DATABASE db15; |
| 287 |
ERROR HY000: Schema 'db15' does not exist, but schema directory './db15/' was found. This must be resolved manually (e.g. by moving the schema directory to another location). |
| 288 |
---- Clean up ---- |
| 289 |
DROP DATABASE db1; |
| 290 |
DROP DATABASE db2; |
| 291 |
DROP DATABASE IF EXISTS db3; |
| 292 |
Warnings: |
| 293 |
Note 1008 Can't drop database 'db3'; database doesn't exist |
| 294 |
DROP DATABASE db4; |
| 295 |
DROP DATABASE db5; |
| 296 |
DROP DATABASE IF EXISTS db6; |
| 297 |
Warnings: |
| 298 |
Note 1008 Can't drop database 'db6'; database doesn't exist |
| 299 |
DROP DATABASE db7; |
| 300 |
DROP DATABASE db8; |
| 301 |
DROP DATABASE IF EXISTS db9; |
| 302 |
Warnings: |
| 303 |
Note 1008 Can't drop database 'db9'; database doesn't exist |
| 304 |
DROP DATABASE db10; |
| 305 |
DROP DATABASE db11; |
| 306 |
DROP DATABASE IF EXISTS db12; |
| 307 |
Warnings: |
| 308 |
Note 1008 Can't drop database 'db12'; database doesn't exist |
| 309 |
include/rpl_sync.inc |
| 310 |
include/rpl_end.inc |