################################################################## # Author: Giuseppe # # Date: 2006-12-14 # # Purpose: To test that event effects are replicated # # in row based format # ################################################################## # Make sure that we have row based bin log -- source include/have_binlog_format_row.inc # Embedded server doesn't support binlogging -- source include/not_embedded.inc -- source include/master-slave.inc # set a passsord for root and remove anonymous users # to make sure that events don't rely on anonymous user for running set global event_scheduler=1; --disable_warnings drop event if exists justonce; drop table if exists t1,t2; --enable_warnings # first, we need a table to record something from an event CREATE TABLE `t1` ( `id` int(10) unsigned NOT NULL auto_increment, `c` varchar(50) NOT NULL, `ts` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; insert into t1 (c) values ('manually'); # then, we create the event create event justonce on schedule at now() + interval 2 second do insert into t1 (c) values ('from justonce'); # wait 6 seconds, so the event can trigger select sleep(3); # check that table t1 contains something --enable_info select * from t1; --disable_info sync_slave_with_master; connection slave; --enable_info select * from t1; --disable_info