| 1 |
# |
| 2 |
# Bug#49132 |
| 3 |
# This test verifies if executing DDL statement before trying to manipulate |
| 4 |
# a temporary table causes row-based replication to break with error 'table |
| 5 |
# does not exist' base on myisam engine. |
| 6 |
# |
| 7 |
|
| 8 |
--source include/not_group_replication_plugin.inc |
| 9 |
source include/have_binlog_format_row.inc; |
| 10 |
source include/force_myisam_default.inc; |
| 11 |
source include/have_myisam.inc; |
| 12 |
source include/set_privilege_checks_user_as_system_user.inc; |
| 13 |
let $rpl_privilege_checks_user_grant_option = 1; |
| 14 |
source include/master-slave.inc; |
| 15 |
|
| 16 |
|
| 17 |
LET $ENGINE_TYPE= MyISAM; |
| 18 |
source extra/rpl_tests/rpl_tmp_table_and_DDL.test; |
| 19 |
--source include/sync_slave_sql_with_master.inc |
| 20 |
|
| 21 |
# |
| 22 |
# BUG#20574550 |
| 23 |
# CREATE TABLE LIKE <TEMP_TABLE> does not preserve original table storage |
| 24 |
# engine when using row based replication |
| 25 |
# |
| 26 |
--connection master |
| 27 |
|
| 28 |
# Define temp_t2 storage engines |
| 29 |
--let $engine_temp_t2= MyISAM |
| 30 |
|
| 31 |
# Create the temporary tables |
| 32 |
--eval CREATE TEMPORARY TABLE temp_t2 (c1 INT) ENGINE=$engine_temp_t2 |
| 33 |
|
| 34 |
# Create t2 based on temporary tables |
| 35 |
CREATE TABLE t2 LIKE temp_t2; |
| 36 |
--sync_slave_with_master |
| 37 |
|
| 38 |
# On master |
| 39 |
--connection master |
| 40 |
# Assert that t2 have the same storage engines as temp_t2 |
| 41 |
--let $engine_t2= query_get_value(SHOW TABLE STATUS WHERE Name='t2', Engine, 1) |
| 42 |
--let $assert_cond= "$engine_t2" = "$engine_temp_t2" |
| 43 |
--let $assert_text= "t2 on master and temp_t2 have the same storage engine" |
| 44 |
--source include/assert.inc |
| 45 |
|
| 46 |
# On slave |
| 47 |
--connection slave |
| 48 |
# Assert that t2 have the same storage engines as temp_t2 |
| 49 |
--let $engine_t2= query_get_value(SHOW TABLE STATUS WHERE Name='t2', Engine, 1) |
| 50 |
--let $assert_cond= "$engine_t2" = "$engine_temp_t2" |
| 51 |
--let $assert_text= "t2 on slave and temp_t2 have the same storage engine" |
| 52 |
--source include/assert.inc |
| 53 |
|
| 54 |
# Cleanup |
| 55 |
--connection master |
| 56 |
DROP TEMPORARY TABLE temp_t2; |
| 57 |
DROP TABLE t2; |
| 58 |
--source include/rpl_end.inc |