mariadb/mysql-test/suite/rpl/r
Mats Kindahl dcd050c550 Bug #34707: Row based replication: slave creates table within wrong database
The failure was caused by executing a CREATE-SELECT statement that creates a
table in another database than the current one. In row-based logging, the
CREATE statement was written to the binary log without the database, hence
creating the table in the wrong database, causing the following inserts to
fail since the table didn't exist in the given database.

Fixed the bug by adding a parameter to store_create_info() that will make
the function print the database name before the table name and used that
in the calls that write the CREATE statement to the binary log. The database
name is only printed if it is different than the currently selected database.

The output of SHOW CREATE TABLE has not changed and is still printed without
the database name.

mysql-test/suite/rpl/t/rpl_row_create_table.test:
  Added test to check that CREATE-SELECT into another database than the
  current one replicates.
sql/sql_insert.cc:
  Adding parameter to calls to store_create_info().
sql/sql_show.cc:
  Adding parameter to calls to store_create_info().
  
  Extending store_create_info() with parameter 'show_database' that will cause
  the database to be written before the table name.
sql/sql_show.h:
  Adding parameter to call to store_create_info() to tell if the database should be shown or not.
sql/sql_table.cc:
  Adding parameter to calls to store_create_info().
2008-10-08 11:15:00 +02:00
..
rpl000001.a.result
rpl000001.b.result
rpl000010.result
rpl000011.result
rpl000013.result
rpl000017.result
rpl_000015.result Fix for versional test 2008-01-14 15:38:02 +08:00
rpl_alter.result
rpl_alter_db.result
rpl_auto_increment.result
rpl_auto_increment_11932.result
rpl_binlog_grant.result
rpl_binlog_query_filter_rules.result Bug#36099 replicate-do-db affects replaying RBR events with mysqlbinlog 2008-09-03 13:01:18 +03:00
rpl_bit.result
rpl_bit_npk.result
rpl_blackhole.result Bug #38360: BLACKHOLE replication with RBR is broken 2008-10-02 11:02:38 +02:00
rpl_bug31076.result
rpl_bug33931.result Removing deliberately generated errors for rpl_bug33931 test 2008-02-19 19:59:48 +01:00
rpl_change_master.result Fix for versional test 2008-01-14 15:38:02 +08:00
rpl_charset.result The test rpl_row_charset and it dependent rpl_ndb_charset is 2008-02-13 11:37:06 +01:00
rpl_charset_sjis.result
rpl_colSize.result
rpl_commit_after_flush.result
rpl_create_database.result Fix for versional test 2008-01-14 15:38:02 +08:00
rpl_critical_errors.result
rpl_critical_errors.result.txt
rpl_ddl.result BUG#36398: 'DROP TEMPORARY TABLE' in ROLLBACK transaction causes transaction to be logged 2008-05-07 13:02:06 +02:00
rpl_deadlock_innodb.result
rpl_delete_no_where.result
rpl_do_grant.result
rpl_drop.result
rpl_drop_db.result
rpl_drop_temp.result
rpl_drop_view.result
rpl_dual_pos_advance.result Merge mysql.com:/home/svoj/devel/mysql/BUG13861/mysql-5.0-engines 2008-03-14 17:54:17 +04:00
rpl_EE_err.result
rpl_empty_master_crash.result
rpl_err_ignoredtable.result
rpl_events.result Bug #36435 rpl_events uses non-deterministic check 2008-04-30 21:41:50 +03:00
rpl_extraCol_innodb.result Bug #22234 Extra Slave Col: Slave should stop on Error Field d of table 2008-03-06 20:32:47 +02:00
rpl_extraCol_myisam.result Post-merge fixes to remove test failures resulting from merge. 2008-03-28 18:56:43 +01:00
rpl_extraColmaster_innodb.result
rpl_extraColmaster_myisam.result
rpl_failed_optimize.result Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that 2008-08-11 20:02:03 +02:00
rpl_filter_tables_not_exist.result Fix cherry picking patch of BUG#37051 2008-08-26 20:11:56 +08:00
rpl_flushlog_loop.result WL#4091, replace sleeps 2008-02-28 14:36:14 +03:00
rpl_foreign_key_innodb.result
rpl_found_rows.result Merge magare.gmz:/home/kgeorge/mysql/work/B36011-take2-5.0-bugteam 2008-05-16 19:03:50 +03:00
rpl_free_items.result
rpl_get_lock.result Fix for Bug#32538: View definition picks up character set, 2008-02-12 22:09:16 +03:00
rpl_grant.result Fix for versional test 2008-01-14 15:38:02 +08:00
rpl_idempotency.result
rpl_ignore_grant.result
rpl_ignore_revoke.result
rpl_ignore_table.result
rpl_ignore_table_update.result
rpl_incident.result
rpl_init_slave.result Merge mail.hezx.com:/media/sda3/work/mysql/bkwork/versional/mysql-5.1-new-rpl 2008-01-14 15:41:28 +08:00
rpl_innodb.result
rpl_innodb_bug28430.result BUG#36379: please re-enable rpl_innodb_bug28430 2008-05-07 12:57:07 +02:00
rpl_innodb_bug30888.result
rpl_innodb_bug30919.result
rpl_innodb_mixed_ddl.result
rpl_innodb_mixed_dml.result Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that 2008-08-11 20:02:03 +02:00
rpl_insert.result
rpl_insert_id.result Fixes to make rpl_insert_id pass in 5.1-bugteam. 2008-05-16 16:08:24 +02:00
rpl_insert_id_pk.result
rpl_insert_ignore.result
rpl_insert_select.result
rpl_invoked_features.result Bug#32663, Bug#33045, Bug#23533, WL#4091 2008-02-29 00:50:15 +03:00
rpl_known_bugs_detection.result
rpl_LD_INFILE.result
rpl_load_from_master.result Fix for versional test 2008-01-14 15:38:02 +08:00
rpl_load_table_from_master.result
rpl_loaddata.result Post-merge fixes. 2008-03-14 17:52:57 +01:00
rpl_loaddata_charset.result
rpl_loaddata_fatal.result
rpl_loaddata_m.result
rpl_loaddata_map.result BUG#38178: rpl_loaddata_map fails sporadically in pushbuild 2008-07-18 13:34:19 +02:00
rpl_loaddata_s.result
rpl_loaddata_simple.result
rpl_loaddatalocal.result
rpl_loadfile.result
rpl_locale.result
rpl_log_pos.result Fix for versional test 2008-01-14 15:38:02 +08:00
rpl_many_optimize.result
rpl_master_pos_wait.result Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl 2008-03-12 13:07:35 +01:00
rpl_misc_functions.result
rpl_mixed_ddl_dml.result
rpl_multi_delete.result
rpl_multi_delete2.result
rpl_multi_engine.result
rpl_multi_update.result
rpl_multi_update2.result
rpl_multi_update3.result
rpl_multi_update4.result
rpl_optimize.result
rpl_packet.result disabled.def: 2008-03-31 19:01:56 +02:00
rpl_plugin_load.result Bug#35807 - INSTALL PLUGIN replicates row-based, but not stmt-based 2008-08-19 17:35:56 +02:00
rpl_ps.result
rpl_rbr_to_sbr.result BUG#29020 (Event results not correctly replicated to slave in RBR): 2008-03-28 13:16:41 +01:00
rpl_read_only.result
rpl_redirect.result
rpl_relay_space_innodb.result
rpl_relay_space_myisam.result
rpl_relayrotate.result
rpl_relayspace.result
rpl_replicate_do.result
rpl_replicate_ignore_db.result
rpl_report.result Bug #28780 report_host is not available through SELECT @@report_host 2008-03-07 14:39:37 +02:00
rpl_rewrt_db.result
rpl_rotate_logs.result Fix for versional test 2008-01-14 15:38:02 +08:00
rpl_row_001.result
rpl_row_4_bytes.result
rpl_row_basic_2myisam.result Bug #32709: Assertion failed: trx_data->empty(), file log.cc 2008-09-03 22:04:07 +02:00
rpl_row_basic_3innodb.result Bug #32709: Assertion failed: trx_data->empty(), file log.cc 2008-09-03 22:04:07 +02:00
rpl_row_basic_8partition.result
rpl_row_basic_11bugs-master.opt
rpl_row_basic_11bugs-slave.opt
rpl_row_basic_11bugs.result BUG#29020 (Event results not correctly replicated to slave in RBR): 2008-03-28 13:16:41 +01:00
rpl_row_blob_innodb.result
rpl_row_blob_myisam.result
rpl_row_colSize.result
rpl_row_create_table.result Bug #34707: Row based replication: slave creates table within wrong database 2008-10-08 11:15:00 +02:00
rpl_row_delayed_ins.result BUG#29020 (Event results not correctly replicated to slave in RBR): 2008-03-28 13:16:41 +01:00
rpl_row_drop.result
rpl_row_err_ignoredtable.result
rpl_row_flsh_tbls.result BUG#29020 (Event results not correctly replicated to slave in RBR): 2008-03-28 13:16:41 +01:00
rpl_row_func001.result
rpl_row_func002.result
rpl_row_func003.result
rpl_row_inexist_tbl.result Merge magare.gmz:/home/kgeorge/mysql/work/B36011-take2-5.0-bugteam 2008-05-16 19:03:50 +03:00
rpl_row_insert_delayed.result
rpl_row_loaddata_m.result
rpl_row_log.result Post-merge fixes to update result files. 2008-09-01 11:27:41 +02:00
rpl_row_log_innodb.result Post-merge fixes to update result files. 2008-09-01 11:27:41 +02:00
rpl_row_max_relay_size.result Fix for versional test 2008-01-14 15:38:02 +08:00
rpl_row_multi_query.result
rpl_row_mysqlbinlog.result BUG#31168: @@hostname does not replicate 2008-03-07 13:59:36 +01:00
rpl_row_mystery22.result
rpl_row_NOW.result
rpl_row_reset_slave.result Fix for versional test 2008-01-14 15:38:02 +08:00
rpl_row_sp001.result
rpl_row_sp002_innodb.result
rpl_row_sp003.result
rpl_row_sp005.result
rpl_row_sp006_InnoDB.result
rpl_row_sp007_innodb.result
rpl_row_sp008.result
rpl_row_sp009.result
rpl_row_sp010.result
rpl_row_sp011.result
rpl_row_sp012.result
rpl_row_stop_middle.result
rpl_row_stop_middle_update.result
rpl_row_tabledefs_2myisam.result bug#32971 manual merge of two tests results 2008-01-31 18:12:58 +02:00
rpl_row_tabledefs_3innodb.result bug#32971 manual merge of two tests results 2008-01-31 18:12:58 +02:00
rpl_row_tabledefs_7ndb.result
rpl_row_trig001.result More fixes to remove test failures in pushbuild. 2008-02-04 12:12:03 +01:00
rpl_row_trig002.result
rpl_row_trig003.result
rpl_row_trig004.result
rpl_row_unsafe_funcs.result
rpl_row_until.result BUG#29020 (Event results not correctly replicated to slave in RBR): 2008-03-28 13:16:41 +01:00
rpl_row_USER.result
rpl_row_UUID.result
rpl_row_view01.result WL#4091, replace sleeps 2008-02-28 14:36:14 +03:00
rpl_server_id.result
rpl_server_id1.result Bug #36818 rpl_server_id1 fails expecting slave has stopped 2008-07-18 14:53:16 +03:00
rpl_server_id2.result
rpl_session_var.result
rpl_set_charset.result
rpl_sf.result
rpl_skip_error.result Post-merge fixes. 2008-03-14 17:52:57 +01:00
rpl_slave_skip.result BUG#29020 (Event results not correctly replicated to slave in RBR): 2008-03-28 13:16:41 +01:00
rpl_slave_status.result BUG#36826: rpl_slave_status fails sporadically in pushbuild 2008-05-26 15:06:49 +02:00
rpl_sp.result WL#4403 deprecate @log and @slow_log_queries variables 2008-10-06 16:22:07 +02:00
rpl_sp004.result
rpl_sp_effects.result
rpl_sporadic_master.result
rpl_ssl.result
rpl_ssl1.result
rpl_start_stop_slave.result
rpl_stm_000001.result
rpl_stm_auto_increment_bug33029.result Bug #35675 reset master finds assert if a binlog file can not be deleted 2008-03-30 00:54:08 +02:00
rpl_stm_EE_err2.result
rpl_stm_flsh_tbls.result
rpl_stm_insert_delayed.result
rpl_stm_log.result Merging 5.0-bugteam into 5.1-bugteam 2008-09-01 11:00:52 +02:00
rpl_stm_max_relay_size.result Fix for versional test 2008-01-14 15:38:02 +08:00
rpl_stm_multi_query.result
rpl_stm_mystery22.result
rpl_stm_no_op.result
rpl_stm_reset_slave.result Fix for versional test 2008-01-14 15:38:02 +08:00
rpl_stm_until.result Fix for versional test 2008-01-14 15:38:02 +08:00
rpl_switch_stm_row_mixed.result Post-merge fixes to remove test failures resulting from merge. 2008-03-28 18:56:43 +01:00
rpl_temp_table.result
rpl_temporary.result Bug #34647 rpl_temporary discovers more than one dump thread and fails to select 2008-07-18 11:20:55 +03:00
rpl_temporary_errors.result Fix for versional test 2008-01-14 15:38:02 +08:00
rpl_timezone.result
rpl_trigger.result
rpl_trunc_temp.result
rpl_truncate_2myisam.result BUG#29020 (Event results not correctly replicated to slave in RBR): 2008-03-28 13:16:41 +01:00
rpl_truncate_3innodb.result
rpl_udf.result
rpl_user.result Fixing result change after merge. 2008-02-04 14:29:23 +01:00
rpl_user_variables.result Merge buzz.(none):/home/davi/mysql-5.0-runtime 2008-02-28 20:22:50 -03:00
rpl_variables.result BUG#38170: rpl_variables failed on pushbuild: could not sync with master 2008-07-17 18:26:59 +02:00
rpl_variables_stm.result Removed pushbuild errors. 2008-03-11 18:43:29 +01:00
rpl_view.result Bug#32575: Parse error of stmt with extended comments on slave side 2008-05-08 14:02:09 +02:00