diff -ruN base/mysql-test/lib/mtr_cases.pl mysql50gpl_semi_sync/mysql-test/lib/mtr_cases.pl --- base/mysql-test/lib/mtr_cases.pl 2007-03-05 11:40:33.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/lib/mtr_cases.pl 2007-04-28 08:58:32.000000000 -0700 @@ -324,15 +324,20 @@ my $master_opt_file= "$testdir/$tname-master.opt"; my $slave_opt_file= "$testdir/$tname-slave.opt"; - my $slave_mi_file= "$testdir/$tname.slave-mi"; + my $slave_mi_files= ["$testdir/$tname.slave-mi", + "$testdir/$tname.slave-mi-1", + "$testdir/$tname.slave-mi-2"]; my $master_sh= "$testdir/$tname-master.sh"; my $slave_sh= "$testdir/$tname-slave.sh"; my $disabled_file= "$testdir/$tname.disabled"; my $im_opt_file= "$testdir/$tname-im.opt"; - $tinfo->{'master_opt'}= []; - $tinfo->{'slave_opt'}= []; - $tinfo->{'slave_mi'}= []; + $tinfo->{'master_opt'}= []; + $tinfo->{'slave_opt'}= []; + $tinfo->{'slave_mi'}= {}; + $tinfo->{'slave_mi'}{0}= []; + $tinfo->{'slave_mi'}{1}= []; + $tinfo->{'slave_mi'}{2}= []; if ( -f $master_opt_file ) { @@ -400,9 +405,14 @@ push(@{$tinfo->{'slave_opt'}}, @$slave_opt); } - if ( -f $slave_mi_file ) + my $mi_idx= 0; + foreach my $slave_mi_file ( @$slave_mi_files ) { - $tinfo->{'slave_mi'}= mtr_get_opts_from_file($slave_mi_file); + if ( -f $slave_mi_file ) + { + $tinfo->{'slave_mi'}{$mi_idx}= mtr_get_opts_from_file($slave_mi_file); + } + $mi_idx+= 1; } if ( -f $master_sh ) diff -ruN base/mysql-test/mysql-test-run.pl mysql50gpl_semi_sync/mysql-test/mysql-test-run.pl --- base/mysql-test/mysql-test-run.pl 2007-03-05 11:21:11.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/mysql-test-run.pl 2007-04-28 08:57:13.000000000 -0700 @@ -280,6 +280,7 @@ our $opt_wait_for_slave; our $opt_warnings; +our $opt_slave_innodb= 0; our $opt_udiff; @@ -305,6 +306,8 @@ our $debug_compiled_binaries; our $glob_tot_real_time= 0; +our $current_testname= ""; + our %mysqld_variables; my $source_dist= 0; @@ -619,6 +622,7 @@ 'testcase-timeout=i' => \$opt_testcase_timeout, 'suite-timeout=i' => \$opt_suite_timeout, 'warnings|log-warnings' => \$opt_warnings, + 'slave-innodb' => \$opt_slave_innodb, 'help|h' => \$opt_usage, ) or usage("Can't read options"); @@ -937,6 +941,14 @@ } # -------------------------------------------------------------------------- + # Big test flags + # -------------------------------------------------------------------------- + if ( $opt_big_test ) + { + $ENV{'BIG_TEST'}= 1; + } + + # -------------------------------------------------------------------------- # Gcov flag # -------------------------------------------------------------------------- if ( $opt_gcov and ! $source_dist ) @@ -1733,7 +1745,9 @@ $ENV{'SLAVE_MYSOCK'}= $slave->[0]->{'path_sock'}; $ENV{'SLAVE_MYPORT'}= $slave->[0]->{'port'}; $ENV{'SLAVE_MYPORT1'}= $slave->[1]->{'port'}; + $ENV{'SLAVE_MYSOCK1'}= $slave->[1]->{'path_sock'}; $ENV{'SLAVE_MYPORT2'}= $slave->[2]->{'port'}; + $ENV{'SLAVE_MYSOCK2'}= $slave->[2]->{'path_sock'}; $ENV{'MYSQL_TCP_PORT'}= $mysqld_variables{'port'}; $ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'master-port'}; @@ -2184,6 +2198,8 @@ if ( ! $glob_win32 ) { symlink("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data_ln"); + my @a = ("chmod", "-R", "o+r", "$glob_mysql_test_dir/std_data"); + system(@a) == 0 or die "system @ failed: $?" } else { @@ -3282,6 +3298,8 @@ $ENV{'TZ'}= $tinfo->{'timezone'}; mtr_verbose("Setting timezone: $tinfo->{'timezone'}"); + $current_testname= $tinfo->{'name'}; + my $master_restart= run_testcase_need_master_restart($tinfo); my $slave_restart= run_testcase_need_slave_restart($tinfo); @@ -3684,7 +3702,15 @@ mtr_add_arg($args, "%s--report-port=%d", $prefix, $slave->[$idx]->{'port'}); mtr_add_arg($args, "%s--report-user=root", $prefix); - mtr_add_arg($args, "%s--skip-innodb", $prefix); + if ( ! $opt_slave_innodb ) + { + mtr_add_arg($args, "%s--skip-innodb", $prefix); + } + else + { + mtr_add_arg($args, "%s--default-table-type=innodb", $prefix); + mtr_add_arg($args, "%s--transaction-isolation=READ-COMMITTED", $prefix); + } mtr_add_arg($args, "%s--skip-ndbcluster", $prefix); mtr_add_arg($args, "%s--skip-slave-start", $prefix); @@ -4374,7 +4400,7 @@ if ( ! $slave->[$idx]->{'pid'} ) { mysqld_start($slave->[$idx],$tinfo->{'slave_opt'}, - $tinfo->{'slave_mi'}); + $tinfo->{'slave_mi'}{$idx}); } } diff -ruN base/mysql-test/r/binlog.result mysql50gpl_semi_sync/mysql-test/r/binlog.result --- base/mysql-test/r/binlog.result 2007-03-05 11:40:30.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/r/binlog.result 2007-04-27 20:13:57.000000000 -0700 @@ -1,6 +1,6 @@ drop table if exists t1, t2; reset master; -create table t1 (a int) engine=bdb; +create table t1 (a int) engine=innodb; create table t2 (a int) engine=innodb; begin; insert t1 values (5); @@ -10,14 +10,14 @@ commit; show binlog events from 98; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=bdb +master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=innodb master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert t1 values (5) -master-bin.000001 # Query 1 # use `test`; COMMIT +master-bin.000001 # Xid 1 # COMMIT /* xid=8 */ master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert t2 values (5) -master-bin.000001 # Xid 1 # COMMIT /* xid=12 */ +master-bin.000001 # Xid 1 # COMMIT /* xid=11 */ drop table t1,t2; reset master; create table t1 (n int) engine=innodb; @@ -128,7 +128,7 @@ master-bin.000001 # Query 1 # use `test`; insert into t1 values(3 + 4) master-bin.000001 # Query 1 # use `test`; insert into t1 values(2 + 4) master-bin.000001 # Query 1 # use `test`; insert into t1 values(1 + 4) -master-bin.000001 # Xid 1 # COMMIT /* xid=19 */ +master-bin.000001 # Xid 1 # COMMIT /* xid=18 */ master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 show binlog events in 'master-bin.000002' from 98; Log_name Pos Event_type Server_id End_log_pos Info diff -ruN base/mysql-test/r/rpl_semi_sync.result mysql50gpl_semi_sync/mysql-test/r/rpl_semi_sync.result --- base/mysql-test/r/rpl_semi_sync.result 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/r/rpl_semi_sync.result 2007-05-01 20:46:11.000000000 -0700 @@ -0,0 +1,418 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +show status like 'Rpl_semi_sync_no_tx'; +Variable_name Value +Rpl_semi_sync_no_tx 0 +show status like 'Rpl_semi_sync_yes_tx'; +Variable_name Value +Rpl_semi_sync_yes_tx 0 +show variables like 'rpl_semi_sync_enabled'; +Variable_name Value +rpl_semi_sync_enabled 1 +stop slave; +show variables like 'rpl_semi_sync_slave_enabled'; +Variable_name Value +rpl_semi_sync_slave_enabled 1 +set global rpl_semi_sync_slave_enabled = 1; +start slave; +show status like 'Rpl_semi_sync_clients'; +Variable_name Value +Rpl_semi_sync_clients 1 +drop table if exists t1; +create table t1(n int) engine = InnoDB; +insert into t1 values (300); +insert into t1 values (299); +insert into t1 values (298); +insert into t1 values (297); +insert into t1 values (296); +insert into t1 values (295); +insert into t1 values (294); +insert into t1 values (293); +insert into t1 values (292); +insert into t1 values (291); +insert into t1 values (290); +insert into t1 values (289); +insert into t1 values (288); +insert into t1 values (287); +insert into t1 values (286); +insert into t1 values (285); +insert into t1 values (284); +insert into t1 values (283); +insert into t1 values (282); +insert into t1 values (281); +insert into t1 values (280); +insert into t1 values (279); +insert into t1 values (278); +insert into t1 values (277); +insert into t1 values (276); +insert into t1 values (275); +insert into t1 values (274); +insert into t1 values (273); +insert into t1 values (272); +insert into t1 values (271); +insert into t1 values (270); +insert into t1 values (269); +insert into t1 values (268); +insert into t1 values (267); +insert into t1 values (266); +insert into t1 values (265); +insert into t1 values (264); +insert into t1 values (263); +insert into t1 values (262); +insert into t1 values (261); +insert into t1 values (260); +insert into t1 values (259); +insert into t1 values (258); +insert into t1 values (257); +insert into t1 values (256); +insert into t1 values (255); +insert into t1 values (254); +insert into t1 values (253); +insert into t1 values (252); +insert into t1 values (251); +insert into t1 values (250); +insert into t1 values (249); +insert into t1 values (248); +insert into t1 values (247); +insert into t1 values (246); +insert into t1 values (245); +insert into t1 values (244); +insert into t1 values (243); +insert into t1 values (242); +insert into t1 values (241); +insert into t1 values (240); +insert into t1 values (239); +insert into t1 values (238); +insert into t1 values (237); +insert into t1 values (236); +insert into t1 values (235); +insert into t1 values (234); +insert into t1 values (233); +insert into t1 values (232); +insert into t1 values (231); +insert into t1 values (230); +insert into t1 values (229); +insert into t1 values (228); +insert into t1 values (227); +insert into t1 values (226); +insert into t1 values (225); +insert into t1 values (224); +insert into t1 values (223); +insert into t1 values (222); +insert into t1 values (221); +insert into t1 values (220); +insert into t1 values (219); +insert into t1 values (218); +insert into t1 values (217); +insert into t1 values (216); +insert into t1 values (215); +insert into t1 values (214); +insert into t1 values (213); +insert into t1 values (212); +insert into t1 values (211); +insert into t1 values (210); +insert into t1 values (209); +insert into t1 values (208); +insert into t1 values (207); +insert into t1 values (206); +insert into t1 values (205); +insert into t1 values (204); +insert into t1 values (203); +insert into t1 values (202); +insert into t1 values (201); +insert into t1 values (200); +insert into t1 values (199); +insert into t1 values (198); +insert into t1 values (197); +insert into t1 values (196); +insert into t1 values (195); +insert into t1 values (194); +insert into t1 values (193); +insert into t1 values (192); +insert into t1 values (191); +insert into t1 values (190); +insert into t1 values (189); +insert into t1 values (188); +insert into t1 values (187); +insert into t1 values (186); +insert into t1 values (185); +insert into t1 values (184); +insert into t1 values (183); +insert into t1 values (182); +insert into t1 values (181); +insert into t1 values (180); +insert into t1 values (179); +insert into t1 values (178); +insert into t1 values (177); +insert into t1 values (176); +insert into t1 values (175); +insert into t1 values (174); +insert into t1 values (173); +insert into t1 values (172); +insert into t1 values (171); +insert into t1 values (170); +insert into t1 values (169); +insert into t1 values (168); +insert into t1 values (167); +insert into t1 values (166); +insert into t1 values (165); +insert into t1 values (164); +insert into t1 values (163); +insert into t1 values (162); +insert into t1 values (161); +insert into t1 values (160); +insert into t1 values (159); +insert into t1 values (158); +insert into t1 values (157); +insert into t1 values (156); +insert into t1 values (155); +insert into t1 values (154); +insert into t1 values (153); +insert into t1 values (152); +insert into t1 values (151); +insert into t1 values (150); +insert into t1 values (149); +insert into t1 values (148); +insert into t1 values (147); +insert into t1 values (146); +insert into t1 values (145); +insert into t1 values (144); +insert into t1 values (143); +insert into t1 values (142); +insert into t1 values (141); +insert into t1 values (140); +insert into t1 values (139); +insert into t1 values (138); +insert into t1 values (137); +insert into t1 values (136); +insert into t1 values (135); +insert into t1 values (134); +insert into t1 values (133); +insert into t1 values (132); +insert into t1 values (131); +insert into t1 values (130); +insert into t1 values (129); +insert into t1 values (128); +insert into t1 values (127); +insert into t1 values (126); +insert into t1 values (125); +insert into t1 values (124); +insert into t1 values (123); +insert into t1 values (122); +insert into t1 values (121); +insert into t1 values (120); +insert into t1 values (119); +insert into t1 values (118); +insert into t1 values (117); +insert into t1 values (116); +insert into t1 values (115); +insert into t1 values (114); +insert into t1 values (113); +insert into t1 values (112); +insert into t1 values (111); +insert into t1 values (110); +insert into t1 values (109); +insert into t1 values (108); +insert into t1 values (107); +insert into t1 values (106); +insert into t1 values (105); +insert into t1 values (104); +insert into t1 values (103); +insert into t1 values (102); +insert into t1 values (101); +insert into t1 values (100); +insert into t1 values (99); +insert into t1 values (98); +insert into t1 values (97); +insert into t1 values (96); +insert into t1 values (95); +insert into t1 values (94); +insert into t1 values (93); +insert into t1 values (92); +insert into t1 values (91); +insert into t1 values (90); +insert into t1 values (89); +insert into t1 values (88); +insert into t1 values (87); +insert into t1 values (86); +insert into t1 values (85); +insert into t1 values (84); +insert into t1 values (83); +insert into t1 values (82); +insert into t1 values (81); +insert into t1 values (80); +insert into t1 values (79); +insert into t1 values (78); +insert into t1 values (77); +insert into t1 values (76); +insert into t1 values (75); +insert into t1 values (74); +insert into t1 values (73); +insert into t1 values (72); +insert into t1 values (71); +insert into t1 values (70); +insert into t1 values (69); +insert into t1 values (68); +insert into t1 values (67); +insert into t1 values (66); +insert into t1 values (65); +insert into t1 values (64); +insert into t1 values (63); +insert into t1 values (62); +insert into t1 values (61); +insert into t1 values (60); +insert into t1 values (59); +insert into t1 values (58); +insert into t1 values (57); +insert into t1 values (56); +insert into t1 values (55); +insert into t1 values (54); +insert into t1 values (53); +insert into t1 values (52); +insert into t1 values (51); +insert into t1 values (50); +insert into t1 values (49); +insert into t1 values (48); +insert into t1 values (47); +insert into t1 values (46); +insert into t1 values (45); +insert into t1 values (44); +insert into t1 values (43); +insert into t1 values (42); +insert into t1 values (41); +insert into t1 values (40); +insert into t1 values (39); +insert into t1 values (38); +insert into t1 values (37); +insert into t1 values (36); +insert into t1 values (35); +insert into t1 values (34); +insert into t1 values (33); +insert into t1 values (32); +insert into t1 values (31); +insert into t1 values (30); +insert into t1 values (29); +insert into t1 values (28); +insert into t1 values (27); +insert into t1 values (26); +insert into t1 values (25); +insert into t1 values (24); +insert into t1 values (23); +insert into t1 values (22); +insert into t1 values (21); +insert into t1 values (20); +insert into t1 values (19); +insert into t1 values (18); +insert into t1 values (17); +insert into t1 values (16); +insert into t1 values (15); +insert into t1 values (14); +insert into t1 values (13); +insert into t1 values (12); +insert into t1 values (11); +insert into t1 values (10); +insert into t1 values (9); +insert into t1 values (8); +insert into t1 values (7); +insert into t1 values (6); +insert into t1 values (5); +insert into t1 values (4); +insert into t1 values (3); +insert into t1 values (2); +insert into t1 values (1); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 35277 +show status like 'Rpl_semi_sync_slave_status'; +Variable_name Value +Rpl_semi_sync_slave_status 1 +select count(distinct n) from t1; +count(distinct n) +300 +select min(n) from t1; +min(n) +1 +select max(n) from t1; +max(n) +300 +stop slave; +show status like 'Rpl_semi_sync_status'; +Variable_name Value +Rpl_semi_sync_status 1 +show status like 'Rpl_semi_sync_no_tx'; +Variable_name Value +Rpl_semi_sync_no_tx 0 +show status like 'Rpl_semi_sync_yes_tx'; +Variable_name Value +Rpl_semi_sync_yes_tx 301 +show status like 'Rpl_semi_sync_clients'; +Variable_name Value +Rpl_semi_sync_clients 1 +begin; +insert into t1 values (500); +delete from t1 where n < 500; +commit; +insert into t1 values (100); +show status like 'Rpl_semi_sync_status'; +Variable_name Value +Rpl_semi_sync_status 0 +show status like 'Rpl_semi_sync_no_tx'; +Variable_name Value +Rpl_semi_sync_no_tx 2 +show status like 'Rpl_semi_sync_yes_tx'; +Variable_name Value +Rpl_semi_sync_yes_tx 301 +show status like 'Rpl_semi_sync_slave_status'; +Variable_name Value +Rpl_semi_sync_slave_status 0 +start slave; +show status like 'Rpl_semi_sync_slave_status'; +Variable_name Value +Rpl_semi_sync_slave_status 1 +select count(distinct n) from t1; +count(distinct n) +2 +select min(n) from t1; +min(n) +100 +select max(n) from t1; +max(n) +500 +drop table t1; +show status like 'Rpl_semi_sync_status'; +Variable_name Value +Rpl_semi_sync_status 1 +show status like 'Rpl_semi_sync_no_tx'; +Variable_name Value +Rpl_semi_sync_no_tx 2 +show status like 'Rpl_semi_sync_yes_tx'; +Variable_name Value +Rpl_semi_sync_yes_tx 302 +stop slave; +show master logs; +Log_name File_size +master-bin.000001 35746 +show variables like 'rpl_semi_sync_enabled'; +Variable_name Value +rpl_semi_sync_enabled 1 +set global rpl_semi_sync_enabled=0; +show variables like 'rpl_semi_sync_enabled'; +Variable_name Value +rpl_semi_sync_enabled 0 +show status like 'Rpl_semi_sync_status'; +Variable_name Value +Rpl_semi_sync_status 0 +set global rpl_semi_sync_enabled=1; +start slave; +create table t1 (a int) engine = InnoDB; +drop table t1; +show status like 'Rpl_semi_sync_status'; +Variable_name Value +Rpl_semi_sync_status 0 +show status like 'Rpl_relay%'; +Variable_name Value +reset master; diff -ruN base/mysql-test/r/rpl_show_processlist.result mysql50gpl_semi_sync/mysql-test/r/rpl_show_processlist.result --- base/mysql-test/r/rpl_show_processlist.result 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/r/rpl_show_processlist.result 2007-04-27 20:14:04.000000000 -0700 @@ -0,0 +1,323 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +drop table if exists t1; +create table t1 (n int); +insert into t1 values (300); +insert into t1 values (299); +insert into t1 values (298); +insert into t1 values (297); +insert into t1 values (296); +insert into t1 values (295); +insert into t1 values (294); +insert into t1 values (293); +insert into t1 values (292); +insert into t1 values (291); +insert into t1 values (290); +insert into t1 values (289); +insert into t1 values (288); +insert into t1 values (287); +insert into t1 values (286); +insert into t1 values (285); +insert into t1 values (284); +insert into t1 values (283); +insert into t1 values (282); +insert into t1 values (281); +insert into t1 values (280); +insert into t1 values (279); +insert into t1 values (278); +insert into t1 values (277); +insert into t1 values (276); +insert into t1 values (275); +insert into t1 values (274); +insert into t1 values (273); +insert into t1 values (272); +insert into t1 values (271); +insert into t1 values (270); +insert into t1 values (269); +insert into t1 values (268); +insert into t1 values (267); +insert into t1 values (266); +insert into t1 values (265); +insert into t1 values (264); +insert into t1 values (263); +insert into t1 values (262); +insert into t1 values (261); +insert into t1 values (260); +insert into t1 values (259); +insert into t1 values (258); +insert into t1 values (257); +insert into t1 values (256); +insert into t1 values (255); +insert into t1 values (254); +insert into t1 values (253); +insert into t1 values (252); +insert into t1 values (251); +insert into t1 values (250); +insert into t1 values (249); +insert into t1 values (248); +insert into t1 values (247); +insert into t1 values (246); +insert into t1 values (245); +insert into t1 values (244); +insert into t1 values (243); +insert into t1 values (242); +insert into t1 values (241); +insert into t1 values (240); +insert into t1 values (239); +insert into t1 values (238); +insert into t1 values (237); +insert into t1 values (236); +insert into t1 values (235); +insert into t1 values (234); +insert into t1 values (233); +insert into t1 values (232); +insert into t1 values (231); +insert into t1 values (230); +insert into t1 values (229); +insert into t1 values (228); +insert into t1 values (227); +insert into t1 values (226); +insert into t1 values (225); +insert into t1 values (224); +insert into t1 values (223); +insert into t1 values (222); +insert into t1 values (221); +insert into t1 values (220); +insert into t1 values (219); +insert into t1 values (218); +insert into t1 values (217); +insert into t1 values (216); +insert into t1 values (215); +insert into t1 values (214); +insert into t1 values (213); +insert into t1 values (212); +insert into t1 values (211); +insert into t1 values (210); +insert into t1 values (209); +insert into t1 values (208); +insert into t1 values (207); +insert into t1 values (206); +insert into t1 values (205); +insert into t1 values (204); +insert into t1 values (203); +insert into t1 values (202); +insert into t1 values (201); +insert into t1 values (200); +insert into t1 values (199); +insert into t1 values (198); +insert into t1 values (197); +insert into t1 values (196); +insert into t1 values (195); +insert into t1 values (194); +insert into t1 values (193); +insert into t1 values (192); +insert into t1 values (191); +insert into t1 values (190); +insert into t1 values (189); +insert into t1 values (188); +insert into t1 values (187); +insert into t1 values (186); +insert into t1 values (185); +insert into t1 values (184); +insert into t1 values (183); +insert into t1 values (182); +insert into t1 values (181); +insert into t1 values (180); +insert into t1 values (179); +insert into t1 values (178); +insert into t1 values (177); +insert into t1 values (176); +insert into t1 values (175); +insert into t1 values (174); +insert into t1 values (173); +insert into t1 values (172); +insert into t1 values (171); +insert into t1 values (170); +insert into t1 values (169); +insert into t1 values (168); +insert into t1 values (167); +insert into t1 values (166); +insert into t1 values (165); +insert into t1 values (164); +insert into t1 values (163); +insert into t1 values (162); +insert into t1 values (161); +insert into t1 values (160); +insert into t1 values (159); +insert into t1 values (158); +insert into t1 values (157); +insert into t1 values (156); +insert into t1 values (155); +insert into t1 values (154); +insert into t1 values (153); +insert into t1 values (152); +insert into t1 values (151); +insert into t1 values (150); +insert into t1 values (149); +insert into t1 values (148); +insert into t1 values (147); +insert into t1 values (146); +insert into t1 values (145); +insert into t1 values (144); +insert into t1 values (143); +insert into t1 values (142); +insert into t1 values (141); +insert into t1 values (140); +insert into t1 values (139); +insert into t1 values (138); +insert into t1 values (137); +insert into t1 values (136); +insert into t1 values (135); +insert into t1 values (134); +insert into t1 values (133); +insert into t1 values (132); +insert into t1 values (131); +insert into t1 values (130); +insert into t1 values (129); +insert into t1 values (128); +insert into t1 values (127); +insert into t1 values (126); +insert into t1 values (125); +insert into t1 values (124); +insert into t1 values (123); +insert into t1 values (122); +insert into t1 values (121); +insert into t1 values (120); +insert into t1 values (119); +insert into t1 values (118); +insert into t1 values (117); +insert into t1 values (116); +insert into t1 values (115); +insert into t1 values (114); +insert into t1 values (113); +insert into t1 values (112); +insert into t1 values (111); +insert into t1 values (110); +insert into t1 values (109); +insert into t1 values (108); +insert into t1 values (107); +insert into t1 values (106); +insert into t1 values (105); +insert into t1 values (104); +insert into t1 values (103); +insert into t1 values (102); +insert into t1 values (101); +insert into t1 values (100); +insert into t1 values (99); +insert into t1 values (98); +insert into t1 values (97); +insert into t1 values (96); +insert into t1 values (95); +insert into t1 values (94); +insert into t1 values (93); +insert into t1 values (92); +insert into t1 values (91); +insert into t1 values (90); +insert into t1 values (89); +insert into t1 values (88); +insert into t1 values (87); +insert into t1 values (86); +insert into t1 values (85); +insert into t1 values (84); +insert into t1 values (83); +insert into t1 values (82); +insert into t1 values (81); +insert into t1 values (80); +insert into t1 values (79); +insert into t1 values (78); +insert into t1 values (77); +insert into t1 values (76); +insert into t1 values (75); +insert into t1 values (74); +insert into t1 values (73); +insert into t1 values (72); +insert into t1 values (71); +insert into t1 values (70); +insert into t1 values (69); +insert into t1 values (68); +insert into t1 values (67); +insert into t1 values (66); +insert into t1 values (65); +insert into t1 values (64); +insert into t1 values (63); +insert into t1 values (62); +insert into t1 values (61); +insert into t1 values (60); +insert into t1 values (59); +insert into t1 values (58); +insert into t1 values (57); +insert into t1 values (56); +insert into t1 values (55); +insert into t1 values (54); +insert into t1 values (53); +insert into t1 values (52); +insert into t1 values (51); +insert into t1 values (50); +insert into t1 values (49); +insert into t1 values (48); +insert into t1 values (47); +insert into t1 values (46); +insert into t1 values (45); +insert into t1 values (44); +insert into t1 values (43); +insert into t1 values (42); +insert into t1 values (41); +insert into t1 values (40); +insert into t1 values (39); +insert into t1 values (38); +insert into t1 values (37); +insert into t1 values (36); +insert into t1 values (35); +insert into t1 values (34); +insert into t1 values (33); +insert into t1 values (32); +insert into t1 values (31); +insert into t1 values (30); +insert into t1 values (29); +insert into t1 values (28); +insert into t1 values (27); +insert into t1 values (26); +insert into t1 values (25); +insert into t1 values (24); +insert into t1 values (23); +insert into t1 values (22); +insert into t1 values (21); +insert into t1 values (20); +insert into t1 values (19); +insert into t1 values (18); +insert into t1 values (17); +insert into t1 values (16); +insert into t1 values (15); +insert into t1 values (14); +insert into t1 values (13); +insert into t1 values (12); +insert into t1 values (11); +insert into t1 values (10); +insert into t1 values (9); +insert into t1 values (8); +insert into t1 values (7); +insert into t1 values (6); +insert into t1 values (5); +insert into t1 values (4); +insert into t1 values (3); +insert into t1 values (2); +insert into t1 values (1); +show processlist; +Id User Host db Command Time State Info +# root # test Sleep # NULL +# root # test Query # NULL show processlist +# root # test Sleep # NULL +# root # NULL Binlog Dump # Has sent all binlog to slave; waiting for binlog to be updated :master-bin.000001:27162: NULL +delete from t1 where n > 50; +delete from t1 where n > 25; +drop table t1; +show processlist; +Id User Host db Command Time State Info +# root # test Sleep # NULL +# root # test Query # NULL show processlist +# root # test Sleep # NULL +# root # NULL Binlog Dump # Has sent all binlog to slave; waiting for binlog to be updated :master-bin.000001:27418: NULL diff -ruN base/mysql-test/rpl_transaction_test/r/rpl000002.result mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl000002.result --- base/mysql-test/rpl_transaction_test/r/rpl000002.result 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl000002.result 2007-04-27 20:14:07.000000000 -0700 @@ -0,0 +1,46 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +create table t1 (n int auto_increment primary key); +set insert_id = 2000; +insert into t1 values (NULL),(NULL),(NULL); +select * from t1; +n +2000 +2001 +2002 +show slave hosts; +Server_id Host Port Rpl_recovery_rank Master_id +2 127.0.0.1 9999 2 1 +drop table t1; +stop slave; +create table t2(id int auto_increment primary key, created datetime); +set timestamp=12345; +insert into t2 set created=now(); +select * from t2; +id created +1 1970-01-01 06:25:45 +create table t3 like t2; +create temporary table t4 like t2; +create table t5 select * from t4; +start slave; +select * from t2; +id created +1 1970-01-01 06:25:45 +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `id` int(11) NOT NULL auto_increment, + `created` datetime default NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +show create table t5; +Table Create Table +t5 CREATE TABLE `t5` ( + `id` int(11) NOT NULL default '0', + `created` datetime default NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2,t3,t5; diff -ruN base/mysql-test/rpl_transaction_test/r/rpl_create_database.result mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_create_database.result --- base/mysql-test/rpl_transaction_test/r/rpl_create_database.result 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_create_database.result 2007-04-27 20:14:07.000000000 -0700 @@ -0,0 +1,87 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +DROP DATABASE IF EXISTS mysqltest_prometheus; +DROP DATABASE IF EXISTS mysqltest_sisyfos; +DROP DATABASE IF EXISTS mysqltest_bob; +DROP DATABASE IF EXISTS mysqltest_bob; +CREATE DATABASE mysqltest_prometheus; +CREATE DATABASE mysqltest_sisyfos; +CREATE DATABASE mysqltest_bob; +USE mysqltest_sisyfos; +CREATE TABLE t1 (b int); +INSERT INTO t1 VALUES(1); +USE mysqltest_bob; +CREATE TABLE t2 (b int); +INSERT INTO t2 VALUES(2); +ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1; +USE mysqltest_sisyfos; +ALTER DATABASE mysqltest_bob CHARACTER SET latin1; +SHOW DATABASES; +Database +information_schema +mysql +mysqltest_bob +mysqltest_prometheus +mysqltest_sisyfos +test +SHOW DATABASES; +Database +information_schema +mysql +mysqltest_prometheus +mysqltest_sisyfos +test +DROP DATABASE IF EXISTS mysqltest_sisyfos; +USE mysqltest_prometheus; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +CREATE DATABASE mysqltest_sisyfos; +USE mysqltest_sisyfos; +CREATE TABLE t2 (a INT); +SHOW BINLOG EVENTS; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 +master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest_prometheus +master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest_sisyfos +master-bin.000001 # Query 1 # CREATE DATABASE mysqltest_prometheus +master-bin.000001 # Query 1 # CREATE DATABASE mysqltest_sisyfos +master-bin.000001 # Query 1 # use `mysqltest_sisyfos`; CREATE TABLE t1 (b int) +master-bin.000001 # Query 1 # use `mysqltest_sisyfos`; INSERT INTO t1 VALUES(1) +master-bin.000001 # Query 1 # ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1 +master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest_sisyfos +master-bin.000001 # Query 1 # use `mysqltest_prometheus`; CREATE TABLE t1 (a INT) +master-bin.000001 # Query 1 # use `mysqltest_prometheus`; INSERT INTO t1 VALUES (1) +master-bin.000001 # Query 1 # CREATE DATABASE mysqltest_sisyfos +master-bin.000001 # Query 1 # use `mysqltest_sisyfos`; CREATE TABLE t2 (a INT) +SHOW DATABASES; +Database +information_schema +mysql +mysqltest_bob +mysqltest_prometheus +mysqltest_sisyfos +test +SHOW DATABASES; +Database +information_schema +mysql +mysqltest_prometheus +mysqltest_sisyfos +test +SHOW CREATE TABLE mysqltest_prometheus.t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SHOW CREATE TABLE mysqltest_sisyfos.t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP DATABASE IF EXISTS mysqltest_prometheus; +DROP DATABASE IF EXISTS mysqltest_sisyfos; +DROP DATABASE IF EXISTS mysqltest_bob; diff -ruN base/mysql-test/rpl_transaction_test/r/rpl_ddl.result mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_ddl.result --- base/mysql-test/rpl_transaction_test/r/rpl_ddl.result 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_ddl.result 2007-04-27 20:14:07.000000000 -0700 @@ -0,0 +1,1693 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +SET AUTOCOMMIT = 1; +DROP DATABASE IF EXISTS mysqltest1; +DROP DATABASE IF EXISTS mysqltest2; +DROP DATABASE IF EXISTS mysqltest3; +CREATE DATABASE mysqltest1; +CREATE DATABASE mysqltest2; +CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE= "InnoDB"; +INSERT INTO mysqltest1.t1 SET f1= 0; +CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE INDEX my_idx6 ON mysqltest1.t6(f1); +CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE= "InnoDB"; +INSERT INTO mysqltest1.t7 SET f1= 0; +CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT); +SET AUTOCOMMIT = 0; +use mysqltest1; + +-------- switch to slave -------- +SET AUTOCOMMIT = 0; +use mysqltest1; + +-------- switch to master ------- + +######## COMMIT ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 0 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +-------- switch to master ------- +COMMIT; +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- + +######## ROLLBACK ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 1 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +2 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +TEST-INFO: MASTER: The INSERT is not committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- + +######## SET AUTOCOMMIT=1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 1 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +2 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +-------- switch to master ------- +SET AUTOCOMMIT=1; +SELECT MAX(f1) FROM t1; +MAX(f1) +2 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +2 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +2 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +2 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SET AUTOCOMMIT=0; + +######## START TRANSACTION ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 2 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +3 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +2 + +-------- switch to master ------- +START TRANSACTION; +SELECT MAX(f1) FROM t1; +MAX(f1) +3 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +3 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +3 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +3 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- + +######## BEGIN ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 3 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +4 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +3 + +-------- switch to master ------- +BEGIN; +SELECT MAX(f1) FROM t1; +MAX(f1) +4 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +4 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +4 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +4 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- + +######## DROP TABLE mysqltest1.t2 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 4 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +5 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +4 + +-------- switch to master ------- +DROP TABLE mysqltest1.t2; +SELECT MAX(f1) FROM t1; +MAX(f1) +5 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +5 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +5 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +5 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW TABLES LIKE 't2'; +Tables_in_mysqltest1 (t2) + +-------- switch to slave -------- +SHOW TABLES LIKE 't2'; +Tables_in_mysqltest1 (t2) + +-------- switch to master ------- + +######## DROP TEMPORARY TABLE mysqltest1.t23 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 5 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +6 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +5 + +-------- switch to master ------- +DROP TEMPORARY TABLE mysqltest1.t23; +SELECT MAX(f1) FROM t1; +MAX(f1) +6 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +5 + +-------- switch to master ------- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +SELECT MAX(f1) FROM t1; +MAX(f1) +5 + +TEST-INFO: MASTER: The INSERT is not committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +5 + +TEST-INFO: SLAVE: The INSERT is not committed (Failed) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW TABLES LIKE 't23'; +Tables_in_mysqltest1 (t23) + +-------- switch to slave -------- +SHOW TABLES LIKE 't23'; +Tables_in_mysqltest1 (t23) + +-------- switch to master ------- + +######## RENAME TABLE mysqltest1.t3 to mysqltest1.t20 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 5 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +6 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +5 + +-------- switch to master ------- +RENAME TABLE mysqltest1.t3 to mysqltest1.t20; +SELECT MAX(f1) FROM t1; +MAX(f1) +6 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +6 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +6 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +6 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW TABLES LIKE 't20'; +Tables_in_mysqltest1 (t20) +t20 + +-------- switch to slave -------- +SHOW TABLES LIKE 't20'; +Tables_in_mysqltest1 (t20) +t20 + +-------- switch to master ------- + +######## ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 6 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +7 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +6 + +-------- switch to master ------- +ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT; +SELECT MAX(f1) FROM t1; +MAX(f1) +7 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +7 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +7 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +7 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +describe mysqltest1.t4; +Field Type Null Key Default Extra +f1 bigint(20) YES NULL +f2 bigint(20) YES NULL + +-------- switch to slave -------- +describe mysqltest1.t4; +Field Type Null Key Default Extra +f1 bigint(20) YES NULL +f2 bigint(20) YES NULL + +-------- switch to master ------- + +######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB" ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 7 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +8 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +7 + +-------- switch to master ------- +CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB"; +SELECT MAX(f1) FROM t1; +MAX(f1) +8 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +8 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +8 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +8 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- + +######## CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 8 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +9 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +8 + +-------- switch to master ------- +CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT); +SELECT MAX(f1) FROM t1; +MAX(f1) +9 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +8 + +-------- switch to master ------- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +SELECT MAX(f1) FROM t1; +MAX(f1) +8 + +TEST-INFO: MASTER: The INSERT is not committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +8 + +TEST-INFO: SLAVE: The INSERT is not committed (Failed) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- + +######## TRUNCATE TABLE mysqltest1.t7 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 8 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +9 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +8 + +-------- switch to master ------- +TRUNCATE TABLE mysqltest1.t7; +SELECT MAX(f1) FROM t1; +MAX(f1) +9 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +9 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +9 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +9 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SELECT * FROM mysqltest1.t7; +f1 + +-------- switch to slave -------- +SELECT * FROM mysqltest1.t7; +f1 + +-------- switch to master ------- + +######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 9 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +9 + +-------- switch to master ------- +LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ; +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +UNLOCK TABLES; + +######## UNLOCK TABLES ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 10 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +11 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +-------- switch to master ------- +UNLOCK TABLES; +SELECT MAX(f1) FROM t1; +MAX(f1) +11 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +TEST-INFO: MASTER: The INSERT is not committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +LOCK TABLES mysqltest1.t1 READ; + +######## UNLOCK TABLES ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 10 + 1; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +-------- switch to master ------- +UNLOCK TABLES; +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +TEST-INFO: MASTER: The INSERT is not committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ; + +######## UNLOCK TABLES ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 10 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +11 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +-------- switch to master ------- +UNLOCK TABLES; +SELECT MAX(f1) FROM t1; +MAX(f1) +11 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +11 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +11 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +11 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- + +######## DROP INDEX my_idx6 ON mysqltest1.t6 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 11 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +12 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +11 + +-------- switch to master ------- +DROP INDEX my_idx6 ON mysqltest1.t6; +SELECT MAX(f1) FROM t1; +MAX(f1) +12 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +12 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +12 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +12 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW INDEX FROM mysqltest1.t6; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment + +-------- switch to slave -------- +SHOW INDEX FROM mysqltest1.t6; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment + +-------- switch to master ------- + +######## CREATE INDEX my_idx5 ON mysqltest1.t5(f1) ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 12 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +13 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +12 + +-------- switch to master ------- +CREATE INDEX my_idx5 ON mysqltest1.t5(f1); +SELECT MAX(f1) FROM t1; +MAX(f1) +13 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +13 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +13 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +13 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW INDEX FROM mysqltest1.t5; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE + +-------- switch to slave -------- +SHOW INDEX FROM mysqltest1.t5; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE + +-------- switch to master ------- + +######## DROP DATABASE mysqltest2 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 13 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +14 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +13 + +-------- switch to master ------- +DROP DATABASE mysqltest2; +SELECT MAX(f1) FROM t1; +MAX(f1) +14 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +14 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +14 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +14 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW DATABASES LIKE "mysqltest2"; +Database (mysqltest2) + +-------- switch to slave -------- +SHOW DATABASES LIKE "mysqltest2"; +Database (mysqltest2) + +-------- switch to master ------- + +######## CREATE DATABASE mysqltest3 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 14 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +15 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +14 + +-------- switch to master ------- +CREATE DATABASE mysqltest3; +SELECT MAX(f1) FROM t1; +MAX(f1) +15 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +15 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +15 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +15 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW DATABASES LIKE "mysqltest3"; +Database (mysqltest3) +mysqltest3 + +-------- switch to slave -------- +SHOW DATABASES LIKE "mysqltest3"; +Database (mysqltest3) +mysqltest3 + +-------- switch to master ------- + +######## CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1" ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 15 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +16 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +15 + +-------- switch to master ------- +CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1"; +SELECT MAX(f1) FROM t1; +MAX(f1) +16 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +16 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +16 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +16 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW PROCEDURE STATUS LIKE 'p1'; +Db mysqltest1 +Name p1 +Type PROCEDURE +Definer root@localhost +Modified # +Created # +Security_type DEFINER +Comment + -------- switch to slave ------- +SHOW PROCEDURE STATUS LIKE 'p1'; +Db mysqltest1 +Name p1 +Type PROCEDURE +Definer root@localhost +Modified # +Created # +Security_type DEFINER +Comment + +######## ALTER PROCEDURE p1 COMMENT "I have been altered" ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 16 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +17 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +16 + +-------- switch to master ------- +ALTER PROCEDURE p1 COMMENT "I have been altered"; +SELECT MAX(f1) FROM t1; +MAX(f1) +17 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +17 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +17 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +17 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW PROCEDURE STATUS LIKE 'p1'; +Db mysqltest1 +Name p1 +Type PROCEDURE +Definer root@localhost +Modified # +Created # +Security_type DEFINER +Comment I have been altered + -------- switch to slave ------- +SHOW PROCEDURE STATUS LIKE 'p1'; +Db mysqltest1 +Name p1 +Type PROCEDURE +Definer root@localhost +Modified # +Created # +Security_type DEFINER +Comment I have been altered + +######## DROP PROCEDURE p1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 17 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +18 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +17 + +-------- switch to master ------- +DROP PROCEDURE p1; +SELECT MAX(f1) FROM t1; +MAX(f1) +18 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +18 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +18 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +18 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW PROCEDURE STATUS LIKE 'p1'; + -------- switch to slave ------- +SHOW PROCEDURE STATUS LIKE 'p1'; + +######## CREATE OR REPLACE VIEW v1 as select * from t1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 18 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +18 + +-------- switch to master ------- +CREATE OR REPLACE VIEW v1 as select * from t1; +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` + +-------- switch to slave ------- +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` + +######## ALTER VIEW v1 AS select f1 from t1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 19 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +-------- switch to master ------- +ALTER VIEW v1 AS select f1 from t1; +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` + +-------- switch to slave ------- +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` + +######## DROP VIEW IF EXISTS v1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 20 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +-------- switch to master ------- +DROP VIEW IF EXISTS v1; +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW CREATE VIEW v1; +ERROR 42S02: Table 'mysqltest1.v1' doesn't exist + +-------- switch to slave ------- +SHOW CREATE VIEW v1; +ERROR 42S02: Table 'mysqltest1.v1' doesn't exist + +######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 21 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +-------- switch to master ------- +CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1; +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode Definer +trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost + +-------- switch to slave ------- +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode Definer +trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost + +######## DROP TRIGGER trg1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 22 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +-------- switch to master ------- +DROP TRIGGER trg1; +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode Definer + +-------- switch to slave ------- +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode Definer + +######## CREATE USER user1@localhost ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 23 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +-------- switch to master ------- +CREATE USER user1@localhost; +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SELECT user FROM mysql.user WHERE user = 'user1'; +user +user1 + +-------- switch to slave ------- +SELECT user FROM mysql.user WHERE user = 'user1'; +user +user1 + +######## RENAME USER user1@localhost TO rename1@localhost ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 24 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +-------- switch to master ------- +RENAME USER user1@localhost TO rename1@localhost; +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SELECT user FROM mysql.user WHERE user = 'rename1'; +user +rename1 + +-------- switch to slave ------- +SELECT user FROM mysql.user WHERE user = 'rename1'; +user +rename1 + +######## DROP USER rename1@localhost ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 25 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +26 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +-------- switch to master ------- +DROP USER rename1@localhost; +SELECT MAX(f1) FROM t1; +MAX(f1) +26 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +26 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +26 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +26 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SELECT user FROM mysql.user WHERE user = 'rename1'; +user + +-------- switch to slave ------- +SELECT user FROM mysql.user WHERE user = 'rename1'; +user +DROP DATABASE IF EXISTS mysqltest1; +DROP DATABASE IF EXISTS mysqltest2; +DROP DATABASE IF EXISTS mysqltest3; diff -ruN base/mysql-test/rpl_transaction_test/r/rpl_loaddata.result mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_loaddata.result --- base/mysql-test/rpl_transaction_test/r/rpl_loaddata.result 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_loaddata.result 2007-04-27 20:14:07.000000000 -0700 @@ -0,0 +1,82 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +reset master; +create table t1(a int not null auto_increment, b int, primary key(a) ); +load data infile '../std_data_ln/rpl_loaddata.dat' into table t1; +create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60)); +load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines; +create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60)); +insert into t3 select * from t2; +select * from t1; +a b +1 10 +2 15 +select * from t3; +day id category name +2003-02-22 2461 b a a a @ %  ' " a +2003-03-22 2161 c asdf +2003-03-22 2416 a bbbbb +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +slave-bin.000001 1557 +drop table t1; +drop table t2; +drop table t3; +create table t1(a int, b int, unique(b)); +insert into t1 values(1,10); +load data infile '../std_data_ln/rpl_loaddata.dat' into table t1; +set global sql_slave_skip_counter=1; +start slave; +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1789 # # master-bin.000001 Yes Yes 0 0 1789 # None 0 No # +set sql_log_bin=0; +delete from t1; +set sql_log_bin=1; +load data infile '../std_data_ln/rpl_loaddata.dat' into table t1; +stop slave; +change master to master_user='test'; +change master to master_user='root'; +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1824 # # master-bin.000001 No No 0 0 1824 # None 0 No # +set global sql_slave_skip_counter=1; +start slave; +set sql_log_bin=0; +delete from t1; +set sql_log_bin=1; +load data infile '../std_data_ln/rpl_loaddata.dat' into table t1; +stop slave; +reset slave; +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 4 # # No No 0 0 0 # None 0 No # +reset master; +create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), +unique(day)) engine=MyISAM; +load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields +terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by +'\n##\n' starting by '>' ignore 1 lines; +ERROR 23000: Duplicate entry '2003-03-22' for key 1 +select * from t2; +day id category name +2003-02-22 2461 b a a a @ %  ' " a +2003-03-22 2161 c asdf +start slave; +select * from t2; +day id category name +2003-02-22 2461 b a a a @ %  ' " a +2003-03-22 2161 c asdf +alter table t2 drop key day; +delete from t2; +load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields +terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by +'\n##\n' starting by '>' ignore 1 lines; +ERROR 23000: Duplicate entry '2003-03-22' for key 1 +drop table t2; +drop table t2; +drop table t1; diff -ruN base/mysql-test/rpl_transaction_test/r/rpl_log.result mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_log.result --- base/mysql-test/rpl_transaction_test/r/rpl_log.result 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_log.result 2007-04-27 20:14:07.000000000 -0700 @@ -0,0 +1,128 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +stop slave; +reset master; +reset slave; +reset master; +create table t1(n int not null auto_increment primary key); +insert into t1 values (NULL); +drop table t1; +create table t1 (word char(20) not null); +load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines; +select count(*) from t1; +count(*) +69 +drop table t1; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 219 Intvar 1 247 INSERT_ID=1 +master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) +master-bin.000001 338 Query 1 414 use `test`; drop table t1 +master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null) +master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581 +master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1 +master-bin.000001 1269 Query 1 1345 use `test`; drop table t1 +show binlog events from 98 limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key) +show binlog events from 98 limit 2; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 219 Intvar 1 247 INSERT_ID=1 +show binlog events from 98 limit 2,1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) +flush logs; +create table t5 (a int); +drop table t5; +start slave; +flush logs; +stop slave; +create table t1 (n int); +insert into t1 values (1); +drop table t1; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 219 Intvar 1 247 INSERT_ID=1 +master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) +master-bin.000001 338 Query 1 414 use `test`; drop table t1 +master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null) +master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581 +master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1 +master-bin.000001 1269 Query 1 1345 use `test`; drop table t1 +master-bin.000001 1345 Rotate 1 1389 master-bin.000002;pos=4 +show binlog events in 'master-bin.000002'; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4 +master-bin.000002 98 Query 1 184 use `test`; create table t5 (a int) +master-bin.000002 184 Query 1 260 use `test`; drop table t5 +master-bin.000002 260 Query 1 346 use `test`; create table t1 (n int) +master-bin.000002 346 Query 1 434 use `test`; insert into t1 values (1) +master-bin.000002 434 Query 1 510 use `test`; drop table t1 +show binary logs; +Log_name File_size +master-bin.000001 1389 +master-bin.000002 510 +start slave; +show binary logs; +Log_name File_size +slave-bin.000001 1742 +slave-bin.000002 443 +show binlog events in 'slave-bin.000001' from 4; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 4 Format_desc 2 98 Server ver: VERSION, Binlog ver: 4 +slave-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key) +slave-bin.000001 219 Query 1 287 use `test`; BEGIN +slave-bin.000001 287 Intvar 1 28 INSERT_ID=1 +slave-bin.000001 315 Query 1 119 use `test`; insert into t1 values (NULL) +slave-bin.000001 406 Xid 1 433 COMMIT /* xid=15 */ +slave-bin.000001 433 Query 1 509 use `test`; drop table t1 +slave-bin.000001 509 Query 1 612 use `test`; create table t1 (word char(20) not null) +slave-bin.000001 612 Query 1 680 use `test`; BEGIN +slave-bin.000001 680 Begin_load_query 1 604 ;file_id=1;block_len=581 +slave-bin.000001 1284 Execute_load_query 1 754 use `test`; load data INFILE '../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1 +slave-bin.000001 1434 Xid 1 1461 COMMIT /* xid=18 */ +slave-bin.000001 1461 Query 1 1537 use `test`; drop table t1 +slave-bin.000001 1537 Query 1 1623 use `test`; create table t5 (a int) +slave-bin.000001 1623 Query 1 1699 use `test`; drop table t5 +slave-bin.000001 1699 Rotate 2 1742 slave-bin.000002;pos=4 +show binlog events in 'slave-bin.000002' from 4; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 4 Format_desc 2 98 Server ver: VERSION, Binlog ver: 4 +slave-bin.000002 98 Query 1 184 use `test`; create table t1 (n int) +slave-bin.000002 184 Query 1 252 use `test`; BEGIN +slave-bin.000002 252 Query 1 88 use `test`; insert into t1 values (1) +slave-bin.000002 340 Xid 1 367 COMMIT /* xid=27 */ +slave-bin.000002 367 Query 1 443 use `test`; drop table t1 +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 510 # # master-bin.000002 Yes Yes 0 0 510 # None 0 No # +show binlog events in 'slave-bin.000005' from 4; +ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log +create table t1(a int auto_increment primary key, b int); +insert into t1 values (NULL, 1); +reset master; +set insert_id=5; +insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()); +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 4 Format_desc 2 98 Server ver: VERSION, Binlog ver: 4 +slave-bin.000001 98 Query 2 166 use `test`; BEGIN +slave-bin.000001 166 Intvar 2 28 LAST_INSERT_ID=1 +slave-bin.000001 194 Intvar 2 56 INSERT_ID=5 +slave-bin.000001 222 Query 2 191 use `test`; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()) +slave-bin.000001 357 Xid 2 384 COMMIT /* xid=38 */ +select * from t1; +a b +1 1 +5 1 +6 1 +drop table t1; diff -ruN base/mysql-test/rpl_transaction_test/r/rpl_sp.result mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_sp.result --- base/mysql-test/rpl_transaction_test/r/rpl_sp.result 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_sp.result 2007-04-27 20:14:07.000000000 -0700 @@ -0,0 +1,468 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +drop database if exists mysqltest1; +create database mysqltest1; +use mysqltest1; +create table t1 (a varchar(100)); +use mysqltest1; +create procedure foo() +begin +declare b int; +set b = 8; +insert into t1 values (b); +insert into t1 values (unix_timestamp()); +end| +select * from mysql.proc where name='foo' and db='mysqltest1'; +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin +declare b int; +set b = 8; +insert into t1 values (b); +insert into t1 values (unix_timestamp()); +end root@localhost # # +select * from mysql.proc where name='foo' and db='mysqltest1'; +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin +declare b int; +set b = 8; +insert into t1 values (b); +insert into t1 values (unix_timestamp()); +end root@localhost # # +set timestamp=1000000000; +call foo(); +select * from t1; +a +8 +1000000000 +select * from t1; +a +8 +1000000000 +delete from t1; +create procedure foo2() +select * from mysqltest1.t1; +call foo2(); +a +alter procedure foo2 contains sql; +drop table t1; +create table t1 (a int); +create table t2 like t1; +create procedure foo3() +deterministic +insert into t1 values (15); +grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1; +grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1; +grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1; +SELECT 1; +1 +1 +create procedure foo4() +deterministic +begin +insert into t2 values(3); +insert into t1 values (5); +end| +call foo4(); +Got one of the listed errors +call foo3(); +show warnings; +Level Code Message +call foo4(); +Got one of the listed errors +alter procedure foo4 sql security invoker; +call foo4(); +show warnings; +Level Code Message +select * from t1; +a +15 +5 +select * from t2; +a +3 +3 +3 +select * from t1; +a +15 +5 +select * from t2; +a +3 +3 +3 +delete from t2; +alter table t2 add unique (a); +drop procedure foo4; +create procedure foo4() +deterministic +begin +insert into t2 values(20),(20); +end| +call foo4(); +ERROR 23000: Duplicate entry '20' for key 1 +show warnings; +Level Code Message +Error 1062 Duplicate entry '20' for key 1 +select * from t2; +a +20 +select * from t2; +a +select * from mysql.proc where name="foo4" and db='mysqltest1'; +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +mysqltest1 foo4 PROCEDURE foo4 SQL CONTAINS_SQL YES DEFINER begin +insert into t2 values(20),(20); +end root@localhost # # +drop procedure foo4; +select * from mysql.proc where name="foo4" and db='mysqltest1'; +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +select * from mysql.proc where name="foo4" and db='mysqltest1'; +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +drop procedure foo; +drop procedure foo2; +drop procedure foo3; +create function fn1(x int) +returns int +begin +insert into t1 values (x); +return x+2; +end| +ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) +create function fn1(x int) +returns int +deterministic +begin +insert into t1 values (x); +return x+2; +end| +delete from t1; +delete from t2; +select fn1(20); +fn1(20) +22 +insert into t2 values(fn1(21)); +select * from t1; +a +20 +21 +select * from t2; +a +23 +select * from t1; +a +20 +21 +select * from t2; +a +23 +drop function fn1; +create function fn1() +returns int +no sql +begin +return unix_timestamp(); +end| +alter function fn1 contains sql; +ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) +delete from t1; +set timestamp=1000000000; +insert into t1 values(fn1()); +create function fn2() +returns int +no sql +begin +return unix_timestamp(); +end| +ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) +set global log_bin_trust_routine_creators=1; +Warnings: +Warning 1287 'log_bin_trust_routine_creators' is deprecated; use 'log_bin_trust_function_creators' instead +set global log_bin_trust_function_creators=0; +set global log_bin_trust_function_creators=1; +set global log_bin_trust_function_creators=1; +create function fn2() +returns int +no sql +begin +return unix_timestamp(); +end| +create function fn3() +returns int +not deterministic +reads sql data +begin +return 0; +end| +select fn3(); +fn3() +0 +select * from mysql.proc where db='mysqltest1'; +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin +return unix_timestamp(); +end root@localhost # # +mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin +return unix_timestamp(); +end zedjzlcsjhd@localhost # # +mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin +return 0; +end root@localhost # # +select * from t1; +a +1000000000 +use mysqltest1; +select * from t1; +a +1000000000 +select * from mysql.proc where db='mysqltest1'; +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin +return unix_timestamp(); +end root@localhost # # +mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin +return unix_timestamp(); +end zedjzlcsjhd@localhost # # +mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin +return 0; +end root@localhost # # +delete from t2; +alter table t2 add unique (a); +drop function fn1; +create function fn1(x int) +returns int +begin +insert into t2 values(x),(x); +return 10; +end| +do fn1(100); +Warnings: +Error 1062 Duplicate entry '100' for key 1 +select fn1(20); +ERROR 23000: Duplicate entry '20' for key 1 +select * from t2; +a +20 +100 +select * from t2; +a +20 +100 +create trigger trg before insert on t1 for each row set new.a= 10; +ERROR 42000: Access denied; you need the SUPER privilege for this operation +delete from t1; +create trigger trg before insert on t1 for each row set new.a= 10; +insert into t1 values (1); +select * from t1; +a +10 +select * from t1; +a +10 +delete from t1; +drop trigger trg; +insert into t1 values (1); +select * from t1; +a +1 +show binlog events in 'master-bin.000001' from 98; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # drop database if exists mysqltest1 +master-bin.000001 # Query 1 # create database mysqltest1 +master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a varchar(100)) +master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo() +begin +declare b int; +set b = 8; +insert into t1 values (b); +insert into t1 values (unix_timestamp()); +end +master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values ( NAME_CONST('b',8)) +master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (unix_timestamp()) +master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1 +master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo2() +select * from mysqltest1.t1 +master-bin.000001 # Query 1 # use `mysqltest1`; alter procedure foo2 contains sql +master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1 +master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int) +master-bin.000001 # Query 1 # use `mysqltest1`; create table t2 like t1 +master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo3() +deterministic +insert into t1 values (15) +master-bin.000001 # Query 1 # use `mysqltest1`; grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1 +master-bin.000001 # Query 1 # use `mysqltest1`; grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1 +master-bin.000001 # Query 1 # use `mysqltest1`; grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1 +master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` procedure foo4() +deterministic +begin +insert into t2 values(3); +insert into t1 values (5); +end +master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(3) +master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (15) +master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(3) +master-bin.000001 # Query 1 # use `mysqltest1`; alter procedure foo4 sql security invoker +master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(3) +master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (5) +master-bin.000001 # Query 1 # use `mysqltest1`; delete from t2 +master-bin.000001 # Query 1 # use `mysqltest1`; alter table t2 add unique (a) +master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo4 +master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo4() +deterministic +begin +insert into t2 values(20),(20); +end +master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(20),(20) +master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo4 +master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo +master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo2 +master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo3 +master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function fn1(x int) +returns int +deterministic +begin +insert into t1 values (x); +return x+2; +end +master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1 +master-bin.000001 # Query 1 # use `mysqltest1`; delete from t2 +master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `fn1`(20) +master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(fn1(21)) +master-bin.000001 # Query 1 # use `mysqltest1`; drop function fn1 +master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function fn1() +returns int +no sql +begin +return unix_timestamp(); +end +master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1 +master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(fn1()) +master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` function fn2() +returns int +no sql +begin +return unix_timestamp(); +end +master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function fn3() +returns int +not deterministic +reads sql data +begin +return 0; +end +master-bin.000001 # Query 1 # use `mysqltest1`; delete from t2 +master-bin.000001 # Query 1 # use `mysqltest1`; alter table t2 add unique (a) +master-bin.000001 # Query 1 # use `mysqltest1`; drop function fn1 +master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function fn1(x int) +returns int +begin +insert into t2 values(x),(x); +return 10; +end +master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `fn1`(100) +master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `fn1`(20) +master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1 +master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10 +master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (1) +master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1 +master-bin.000001 # Query 1 # use `mysqltest1`; drop trigger trg +master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (1) +select * from t1; +a +1 +create procedure foo() +not deterministic +reads sql data +select * from t1; +call foo(); +a +1 +drop procedure foo; +drop function fn1; +drop database mysqltest1; +drop user "zedjzlcsjhd"@127.0.0.1; +use test; +use test; +drop function if exists f1; +create function f1() returns int reads sql data +begin +declare var integer; +declare c cursor for select a from v1; +open c; +fetch c into var; +close c; +return var; +end| +create view v1 as select 1 as a; +create table t1 (a int); +insert into t1 (a) values (f1()); +select * from t1; +a +1 +drop view v1; +drop function f1; +select * from t1; +a +1 +DROP PROCEDURE IF EXISTS p1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(col VARCHAR(10)); +CREATE PROCEDURE p1(arg VARCHAR(10)) +INSERT INTO t1 VALUES(arg); +CALL p1('test'); +SELECT * FROM t1; +col +test +SELECT * FROM t1; +col +test +DROP PROCEDURE p1; + +---> Test for BUG#20438 + +---> Preparing environment... +---> connection: master +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; + +---> Synchronizing slave with master... + +---> connection: master + +---> Creating procedure... +/*!50003 CREATE PROCEDURE p1() SET @a = 1 */; +/*!50003 CREATE FUNCTION f1() RETURNS INT RETURN 0 */; + +---> Checking on master... +SHOW CREATE PROCEDURE p1; +Procedure sql_mode Create Procedure +p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +SET @a = 1 +SHOW CREATE FUNCTION f1; +Function sql_mode Create Function +f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) +RETURN 0 + +---> Synchronizing slave with master... +---> connection: master + +---> Checking on slave... +SHOW CREATE PROCEDURE p1; +Procedure sql_mode Create Procedure +p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +SET @a = 1 +SHOW CREATE FUNCTION f1; +Function sql_mode Create Function +f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) +RETURN 0 + +---> connection: master + +---> Cleaning up... +DROP PROCEDURE p1; +DROP FUNCTION f1; +drop table t1; diff -ruN base/mysql-test/rpl_transaction_test/r/rpl_transaction_001.result mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_transaction_001.result --- base/mysql-test/rpl_transaction_test/r/rpl_transaction_001.result 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_transaction_001.result 2007-04-27 20:14:07.000000000 -0700 @@ -0,0 +1,143 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +drop table if exists t1; +create table t1(n int primary key); +drop database if exists ignore_db; +create database ignore_db; +use test; +insert into t1 values (700); +use ignore_db; +create table ign1(n int primary key); +insert into ign1 values (70); +insert into ign1 values (69); +insert into ign1 values (68); +insert into ign1 values (67); +insert into ign1 values (66); +insert into ign1 values (65); +insert into ign1 values (64); +insert into ign1 values (63); +insert into ign1 values (62); +insert into ign1 values (61); +insert into ign1 values (60); +insert into ign1 values (59); +insert into ign1 values (58); +insert into ign1 values (57); +insert into ign1 values (56); +insert into ign1 values (55); +insert into ign1 values (54); +insert into ign1 values (53); +insert into ign1 values (52); +insert into ign1 values (51); +insert into ign1 values (50); +insert into ign1 values (49); +insert into ign1 values (48); +insert into ign1 values (47); +insert into ign1 values (46); +insert into ign1 values (45); +insert into ign1 values (44); +insert into ign1 values (43); +insert into ign1 values (42); +insert into ign1 values (41); +insert into ign1 values (40); +insert into ign1 values (39); +insert into ign1 values (38); +insert into ign1 values (37); +insert into ign1 values (36); +insert into ign1 values (35); +insert into ign1 values (34); +insert into ign1 values (33); +insert into ign1 values (32); +insert into ign1 values (31); +insert into ign1 values (30); +insert into ign1 values (29); +insert into ign1 values (28); +insert into ign1 values (27); +insert into ign1 values (26); +insert into ign1 values (25); +insert into ign1 values (24); +insert into ign1 values (23); +insert into ign1 values (22); +insert into ign1 values (21); +insert into ign1 values (20); +insert into ign1 values (19); +insert into ign1 values (18); +insert into ign1 values (17); +insert into ign1 values (16); +insert into ign1 values (15); +insert into ign1 values (14); +insert into ign1 values (13); +insert into ign1 values (12); +insert into ign1 values (11); +insert into ign1 values (10); +insert into ign1 values (9); +insert into ign1 values (8); +insert into ign1 values (7); +insert into ign1 values (6); +insert into ign1 values (5); +insert into ign1 values (4); +insert into ign1 values (3); +insert into ign1 values (2); +insert into ign1 values (1); +use test; +insert into t1 values (701); +insert into t1 values (50); +insert into t1 values (49); +insert into t1 values (48); +insert into t1 values (47); +insert into t1 values (46); +insert into t1 values (45); +insert into t1 values (44); +insert into t1 values (43); +insert into t1 values (42); +insert into t1 values (41); +insert into t1 values (40); +insert into t1 values (39); +insert into t1 values (38); +insert into t1 values (37); +insert into t1 values (36); +insert into t1 values (35); +insert into t1 values (34); +insert into t1 values (33); +insert into t1 values (32); +insert into t1 values (31); +insert into t1 values (30); +insert into t1 values (29); +insert into t1 values (28); +insert into t1 values (27); +insert into t1 values (26); +insert into t1 values (25); +insert into t1 values (24); +insert into t1 values (23); +insert into t1 values (22); +insert into t1 values (21); +insert into t1 values (20); +insert into t1 values (19); +insert into t1 values (18); +insert into t1 values (17); +insert into t1 values (16); +insert into t1 values (15); +insert into t1 values (14); +insert into t1 values (13); +insert into t1 values (12); +insert into t1 values (11); +insert into t1 values (10); +insert into t1 values (9); +insert into t1 values (8); +insert into t1 values (7); +insert into t1 values (6); +insert into t1 values (5); +insert into t1 values (4); +insert into t1 values (3); +insert into t1 values (2); +insert into t1 values (1); +select count(*) from t1; +count(*) +52 +select * from ign1; +ERROR 42S02: Table 'test.ign1' doesn't exist +drop table t1; +drop database ignore_db; diff -ruN base/mysql-test/rpl_transaction_test/r/rpl_user_variables.result mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_user_variables.result --- base/mysql-test/rpl_transaction_test/r/rpl_user_variables.result 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_user_variables.result 2007-04-27 20:14:07.000000000 -0700 @@ -0,0 +1,131 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +reset master; +create table t1(n char(30)); +set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1; +set @s1:='This is a test', @r1:=12.5, @r2:=-12.5; +set @n1:=null; +set @s2:='', @s3:='abc\'def', @s4:= 'abc\\def', @s5:= 'abc''def'; +insert into t1 values (@i1), (@i2), (@i3), (@i4); +insert into t1 values (@r1), (@r2); +insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5); +insert into t1 values (@n1); +insert into t1 values (@n2); +insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1); +insert into t1 values (@a+(@b:=@a+1)); +set @q:='abc'; +insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2')); +set @a:=5; +insert into t1 values (@a),(@a); +insert into t1 values (@a),(@a),(@a*5); +select * from t1; +n +12345678901234 +-12345678901234 +0 +-1 +12.5 +-12.5 +This is a test + +abc'def +abc\def +abc'def +NULL +NULL +0 +1 +2 +5 +abc +abcn1 +abcn1n2 +5 +5 +NULL +NULL +NULL +select * from t1; +n +12345678901234 +-12345678901234 +0 +-1 +12.5 +-12.5 +This is a test + +abc'def +abc\def +abc'def +NULL +NULL +0 +1 +2 +5 +abc +abcn1 +abcn1n2 +5 +5 +NULL +NULL +NULL +show binlog events from 98; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query 1 # use `test`; create table t1(n char(30)) +slave-bin.000001 # Query 1 # use `test`; BEGIN +slave-bin.000001 # User var 2 # @`i1`=12345678901234 +slave-bin.000001 # User var 2 # @`i2`=-12345678901234 +slave-bin.000001 # User var 2 # @`i3`=0 +slave-bin.000001 # User var 2 # @`i4`=-1 +slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@i1), (@i2), (@i3), (@i4) +slave-bin.000001 # Xid 1 # COMMIT /* xid=11 */ +slave-bin.000001 # Query 1 # use `test`; BEGIN +slave-bin.000001 # User var 2 # @`r1`=12.5 +slave-bin.000001 # User var 2 # @`r2`=-12.5 +slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@r1), (@r2) +slave-bin.000001 # Xid 1 # COMMIT /* xid=12 */ +slave-bin.000001 # Query 1 # use `test`; BEGIN +slave-bin.000001 # User var 2 # @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci +slave-bin.000001 # User var 2 # @`s2`=_latin1 "" COLLATE latin1_swedish_ci +slave-bin.000001 # User var 2 # @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci +slave-bin.000001 # User var 2 # @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci +slave-bin.000001 # User var 2 # @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci +slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5) +slave-bin.000001 # Xid 1 # COMMIT /* xid=13 */ +slave-bin.000001 # Query 1 # use `test`; BEGIN +slave-bin.000001 # User var 2 # @`n1`=NULL +slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@n1) +slave-bin.000001 # Xid 1 # COMMIT /* xid=14 */ +slave-bin.000001 # Query 1 # use `test`; BEGIN +slave-bin.000001 # User var 2 # @`n2`=NULL +slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@n2) +slave-bin.000001 # Xid 1 # COMMIT /* xid=15 */ +slave-bin.000001 # Query 1 # use `test`; BEGIN +slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1) +slave-bin.000001 # Xid 1 # COMMIT /* xid=16 */ +slave-bin.000001 # Query 1 # use `test`; BEGIN +slave-bin.000001 # User var 2 # @`a`=2 +slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@a+(@b:=@a+1)) +slave-bin.000001 # Xid 1 # COMMIT /* xid=17 */ +slave-bin.000001 # Query 1 # use `test`; BEGIN +slave-bin.000001 # User var 2 # @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci +slave-bin.000001 # Query 1 # use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2')) +slave-bin.000001 # Xid 1 # COMMIT /* xid=18 */ +slave-bin.000001 # Query 1 # use `test`; BEGIN +slave-bin.000001 # User var 2 # @`a`=5 +slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@a),(@a) +slave-bin.000001 # Xid 1 # COMMIT /* xid=19 */ +slave-bin.000001 # Query 1 # use `test`; BEGIN +slave-bin.000001 # User var 2 # @`a`=NULL +slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@a),(@a),(@a*5) +slave-bin.000001 # Xid 1 # COMMIT /* xid=20 */ +insert into t1 select * FROM (select @var1 union select @var2) AS t2; +drop table t1; +stop slave; diff -ruN base/mysql-test/rpl_transaction_test/r/rpl_view.result mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_view.result --- base/mysql-test/rpl_transaction_test/r/rpl_view.result 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/r/rpl_view.result 2007-04-27 20:14:07.000000000 -0700 @@ -0,0 +1,117 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +drop table if exists t1,v1; +drop view if exists t1,v1; +reset master; +create table t1 (a int); +insert into t1 values (1); +create view v1 as select a from t1; +insert into v1 values (2); +select * from v1 order by a; +a +1 +2 +select * from v1 order by a; +a +1 +2 +update v1 set a=3 where a=1; +select * from v1 order by a; +a +2 +3 +select * from v1 order by a; +a +2 +3 +delete from v1 where a=2; +select * from v1 order by a; +a +3 +select * from v1 order by a; +a +3 +alter view v1 as select a as b from t1; +select * from v1 order by 1; +b +3 +drop view v1; +select * from v1 order by a; +ERROR 42S02: Table 'test.v1' doesn't exist +drop table t1; +show binlog events limit 1,100; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query 1 # use `test`; create table t1 (a int) +slave-bin.000001 # Query 1 # use `test`; BEGIN +slave-bin.000001 # Query 1 # use `test`; insert into t1 values (1) +slave-bin.000001 # Xid 1 # COMMIT /* xid=13 */ +slave-bin.000001 # Query 1 # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select a from t1 +slave-bin.000001 # Query 1 # use `test`; BEGIN +slave-bin.000001 # Query 1 # use `test`; insert into v1 values (2) +slave-bin.000001 # Xid 1 # COMMIT /* xid=15 */ +slave-bin.000001 # Query 1 # use `test`; BEGIN +slave-bin.000001 # Query 1 # use `test`; update v1 set a=3 where a=1 +slave-bin.000001 # Xid 1 # COMMIT /* xid=18 */ +slave-bin.000001 # Query 1 # use `test`; BEGIN +slave-bin.000001 # Query 1 # use `test`; delete from v1 where a=2 +slave-bin.000001 # Xid 1 # COMMIT /* xid=21 */ +slave-bin.000001 # Query 1 # use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select a as b from t1 +slave-bin.000001 # Query 1 # use `test`; drop view v1 +slave-bin.000001 # Query 1 # use `test`; drop table t1 + +---> Test for BUG#20438 + +---> Preparing environment... +---> connection: master +DROP TABLE IF EXISTS t1; +DROP VIEW IF EXISTS v1; + +---> Synchronizing slave with master... + +---> connection: master + +---> Creating objects... +CREATE TABLE t1(c INT); +/*!50003 CREATE VIEW v1 AS SELECT * FROM t1 */; + +---> Inserting value... +INSERT INTO t1 VALUES(1); + +---> Checking on master... +SELECT * FROM t1; +c +1 + +---> Synchronizing slave with master... +---> connection: master + +---> Checking on slave... +SELECT * FROM t1; +c +1 + +---> connection: master + +---> Cleaning up... +DROP VIEW v1; +DROP TABLE t1; +create table t1(a int, b int); +insert into t1 values (1, 1), (1, 2), (1, 3); +create view v1(a, b) as select a, sum(b) from t1 group by a; +explain v1; +Field Type Null Key Default Extra +a int(11) YES NULL +b decimal(32,0) YES NULL +show create table v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,sum(`t1`.`b`) AS `b` from `t1` group by `t1`.`a` +select * from v1; +a b +1 6 +drop table t1; +drop view v1; +End of 5.0 tests diff -ruN base/mysql-test/rpl_transaction_test/README mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/README --- base/mysql-test/rpl_transaction_test/README 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/README 2007-04-27 20:14:07.000000000 -0700 @@ -0,0 +1,15 @@ +The tests under this directory is to support the transaction support for replication. +We have to store those tests in a different place because some test results are different +when transaction support is enabled. + +How to run those tests: + . copy all test files to their corresponding directories + . ./mysql-test-run.pl --mysqld="--rpl_transaction_enabled=1" --slave-innodb --do-test=rpl + + +rpl_transaction_001 need manual verification: + . ./mysql-test-run.pl --mysqld="--rpl_transaction_enabled=1" --slave-innodb rpl_transaction_001 + . slave-relay-bin.000006: should be the only relay-log left + . the first event after start event in slave-relay-bin.000006 should be + - server id -1 end_log_pos 236 Rotate to master-bin.000001 pos: 11735 + - the position "pos: 11735" must be correct diff -ruN base/mysql-test/rpl_transaction_test/t/rpl_sp.test mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/t/rpl_sp.test --- base/mysql-test/rpl_transaction_test/t/rpl_sp.test 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/t/rpl_sp.test 2007-04-27 20:14:07.000000000 -0700 @@ -0,0 +1,522 @@ +# Test of replication of stored procedures (WL#2146 for MySQL 5.0) +# Modified by WL#2971. + +# Note that in the .opt files we still use the old variable name +# log-bin-trust-routine-creators so that this test checks that it's +# still accepted (this test also checks that the new name is +# accepted). The old name could be removed in 5.1 or 6.0. + +source include/master-slave.inc; + +# we need a db != test, where we don't have automatic grants +--disable_warnings +drop database if exists mysqltest1; +--enable_warnings +create database mysqltest1; +use mysqltest1; +create table t1 (a varchar(100)); +sync_slave_with_master; +use mysqltest1; + +# ********************** PART 1 : STORED PROCEDURES *************** + +# Does the same proc as on master get inserted into mysql.proc ? +# (same definer, same properties...) + +connection master; + +delimiter |; + +# Stored procedures don't have the limitations that functions have +# regarding binlogging: it's ok to create a procedure as not +# deterministic and updating data, while it's not ok to create such a +# function. We test this. + +create procedure foo() +begin + declare b int; + set b = 8; + insert into t1 values (b); + insert into t1 values (unix_timestamp()); +end| +delimiter ;| + +# we replace columns having times +# (even with fixed timestamp displayed time may changed based on TZ) +--replace_result localhost.localdomain localhost 127.0.0.1 localhost +--replace_column 13 # 14 # +select * from mysql.proc where name='foo' and db='mysqltest1'; +sync_slave_with_master; +# You will notice in the result that the definer does not match what +# it is on master, it is a known bug on which Alik is working +--replace_result localhost.localdomain localhost 127.0.0.1 localhost +--replace_column 13 # 14 # +select * from mysql.proc where name='foo' and db='mysqltest1'; + +connection master; +# see if timestamp used in SP on slave is same as on master +set timestamp=1000000000; +call foo(); +select * from t1; +sync_slave_with_master; +select * from t1; + +# Now a SP which is not updating tables + +connection master; +delete from t1; +create procedure foo2() + select * from mysqltest1.t1; +call foo2(); + +# check that this is allowed (it's not for functions): +alter procedure foo2 contains sql; + +# SP with definer's right + +drop table t1; +create table t1 (a int); +create table t2 like t1; + +create procedure foo3() + deterministic + insert into t1 values (15); + +# let's create a non-privileged user +grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1; +grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1; +grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1; + +# ToDo: BUG#14931: There is a race between the last grant binlogging, and +# the binlogging in the new connection made below, causing sporadic test +# failures due to switched statement order in binlog. To fix this we do +# SELECT 1 in the first connection before starting the second, ensuring +# that binlogging is done in the expected order. +# Please remove this SELECT 1 when BUG#14931 is fixed. +SELECT 1; + +connect (con1,127.0.0.1,zedjzlcsjhd,,mysqltest1,$MASTER_MYPORT,); +connection con1; + +# this routine will fail in the second INSERT because of privileges +delimiter |; +create procedure foo4() + deterministic + begin + insert into t2 values(3); + insert into t1 values (5); + end| + +delimiter ;| + +# I add ,0 so that it does not print the error in the test output, +# because this error is hostname-dependent +--error 1142,0 +call foo4(); # invoker has no INSERT grant on table t1 => failure + +connection master; +call foo3(); # success (definer == root) +show warnings; + +--error 1142,0 +call foo4(); # definer's rights => failure + +# we test replication of ALTER PROCEDURE +alter procedure foo4 sql security invoker; +call foo4(); # invoker's rights => success +show warnings; + +# Note that half-failed procedure calls are ok with binlogging; +# if we compare t2 on master and slave we see they are identical: + +select * from t1; +select * from t2; +sync_slave_with_master; +select * from t1; +select * from t2; + +# Let's check another failing-in-the-middle procedure +connection master; +delete from t2; +alter table t2 add unique (a); + +drop procedure foo4; +delimiter |; +create procedure foo4() + deterministic + begin + insert into t2 values(20),(20); + end| + +delimiter ;| + +--error 1062 +call foo4(); +show warnings; + +select * from t2; +sync_slave_with_master; +# check that this failed-in-the-middle replicated right: +select * from t2; + +# Test of DROP PROCEDURE + +--replace_result localhost.localdomain localhost 127.0.0.1 localhost +--replace_column 13 # 14 # +select * from mysql.proc where name="foo4" and db='mysqltest1'; +connection master; +drop procedure foo4; +select * from mysql.proc where name="foo4" and db='mysqltest1'; +sync_slave_with_master; +select * from mysql.proc where name="foo4" and db='mysqltest1'; + +# ********************** PART 2 : FUNCTIONS *************** + +connection master; +drop procedure foo; +drop procedure foo2; +drop procedure foo3; + +delimiter |; +# check that needs "deterministic" +--error 1418 +create function fn1(x int) + returns int +begin + insert into t1 values (x); + return x+2; +end| +create function fn1(x int) + returns int + deterministic +begin + insert into t1 values (x); + return x+2; +end| + +delimiter ;| +delete from t1; +delete from t2; +select fn1(20); +insert into t2 values(fn1(21)); +select * from t1; +select * from t2; +sync_slave_with_master; +select * from t1; +select * from t2; + +connection master; +delimiter |; + +drop function fn1; + +create function fn1() + returns int + no sql +begin + return unix_timestamp(); +end| + +delimiter ;| +# check that needs "deterministic" +--error 1418 +alter function fn1 contains sql; + +delete from t1; +set timestamp=1000000000; +insert into t1 values(fn1()); + +connection con1; + +delimiter |; +--error 1419 # only full-global-privs user can create a function +create function fn2() + returns int + no sql +begin + return unix_timestamp(); +end| +delimiter ;| +connection master; +# test old variable name: +set global log_bin_trust_routine_creators=1; +# now use new name: +set global log_bin_trust_function_creators=0; +set global log_bin_trust_function_creators=1; +# slave needs it too otherwise will not execute what master allowed: +connection slave; +set global log_bin_trust_function_creators=1; + +connection con1; + +delimiter |; +create function fn2() + returns int + no sql +begin + return unix_timestamp(); +end| +delimiter ;| + +connection master; + +# Now a function which is supposed to not update tables +# as it's "reads sql data", so should not give error even if +# non-deterministic. + +delimiter |; +create function fn3() + returns int + not deterministic + reads sql data +begin + return 0; +end| +delimiter ;| + +select fn3(); +--replace_result localhost.localdomain localhost 127.0.0.1 localhost +--replace_column 13 # 14 # +select * from mysql.proc where db='mysqltest1'; +select * from t1; + +sync_slave_with_master; +use mysqltest1; +select * from t1; +--replace_result localhost.localdomain localhost 127.0.0.1 localhost +--replace_column 13 # 14 # +select * from mysql.proc where db='mysqltest1'; + +# Let's check a failing-in-the-middle function +connection master; +delete from t2; +alter table t2 add unique (a); + +drop function fn1; + +delimiter |; +create function fn1(x int) + returns int +begin + insert into t2 values(x),(x); + return 10; +end| + +delimiter ;| + +do fn1(100); + +--error 1062 +select fn1(20); + +select * from t2; +sync_slave_with_master; + +# check that this failed-in-the-middle replicated right: +select * from t2; + +# ********************** PART 3 : TRIGGERS *************** + +connection con1; +--error 1227 +create trigger trg before insert on t1 for each row set new.a= 10; + +connection master; +delete from t1; +# TODO: when triggers can contain an update, test that this update +# does not go into binlog. +# I'm not setting user vars in the trigger, because replication of user vars +# would take care of propagating the user var's value to slave, so even if +# the trigger was not executed on slave it would not be discovered. +create trigger trg before insert on t1 for each row set new.a= 10; +insert into t1 values (1); +select * from t1; +sync_slave_with_master; +select * from t1; + +connection master; +delete from t1; +drop trigger trg; +insert into t1 values (1); +select * from t1; +--replace_column 2 # 5 # +show binlog events in 'master-bin.000001' from 98; +sync_slave_with_master; +select * from t1; + + +# +# Test for bug #13969 "Routines which are replicated from master can't be +# executed on slave". +# +connection master; +create procedure foo() + not deterministic + reads sql data + select * from t1; +sync_slave_with_master; +# This should not fail +call foo(); +connection master; +drop procedure foo; +sync_slave_with_master; + + +# Clean up +connection master; +drop function fn1; +drop database mysqltest1; +drop user "zedjzlcsjhd"@127.0.0.1; +use test; +sync_slave_with_master; +use test; + +# +# Bug#14077 "Failure to replicate a stored function with a cursor": +# verify that stored routines with cursors work on slave. +# +connection master; +--disable_warnings +drop function if exists f1; +--enable_warnings +delimiter |; +create function f1() returns int reads sql data +begin + declare var integer; + declare c cursor for select a from v1; + open c; + fetch c into var; + close c; + return var; +end| +delimiter ;| +create view v1 as select 1 as a; +create table t1 (a int); +insert into t1 (a) values (f1()); +select * from t1; +drop view v1; +drop function f1; +sync_slave_with_master; +connection slave; +select * from t1; + +# +# Bug#16621 "INSERTs in Stored Procedures causes data corruption in the Binary +# Log for 5.0.18" +# + +# Prepare environment. + +connection master; + +--disable_warnings +DROP PROCEDURE IF EXISTS p1; +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Test case. + +CREATE TABLE t1(col VARCHAR(10)); + +CREATE PROCEDURE p1(arg VARCHAR(10)) + INSERT INTO t1 VALUES(arg); + +CALL p1('test'); + +SELECT * FROM t1; + +sync_slave_with_master; +connection slave; + +SELECT * FROM t1; + +# Cleanup. + +connection master; + +DROP PROCEDURE p1; + + +# +# BUG#20438: CREATE statements for views, stored routines and triggers can be +# not replicable. +# + +--echo +--echo ---> Test for BUG#20438 + +# Prepare environment. + +--echo +--echo ---> Preparing environment... +--echo ---> connection: master +--connection master + +--disable_warnings +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +--enable_warnings + +--echo +--echo ---> Synchronizing slave with master... + +--save_master_pos +--connection slave +--sync_with_master + +--echo +--echo ---> connection: master +--connection master + +# Test. + +--echo +--echo ---> Creating procedure... + +/*!50003 CREATE PROCEDURE p1() SET @a = 1 */; + +/*!50003 CREATE FUNCTION f1() RETURNS INT RETURN 0 */; + +--echo +--echo ---> Checking on master... + +SHOW CREATE PROCEDURE p1; +SHOW CREATE FUNCTION f1; + +--echo +--echo ---> Synchronizing slave with master... + +--save_master_pos +--connection slave +--sync_with_master + +--echo ---> connection: master + +--echo +--echo ---> Checking on slave... + +SHOW CREATE PROCEDURE p1; +SHOW CREATE FUNCTION f1; + +# Cleanup. + +--echo +--echo ---> connection: master +--connection master + +--echo +--echo ---> Cleaning up... + +DROP PROCEDURE p1; +DROP FUNCTION f1; + +--save_master_pos +--connection slave +--sync_with_master +--connection master + + +# cleanup +connection master; +drop table t1; +sync_slave_with_master; diff -ruN base/mysql-test/rpl_transaction_test/t/rpl_transaction_001-slave.opt mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/t/rpl_transaction_001-slave.opt --- base/mysql-test/rpl_transaction_test/t/rpl_transaction_001-slave.opt 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/t/rpl_transaction_001-slave.opt 2007-04-27 20:14:07.000000000 -0700 @@ -0,0 +1 @@ +-O max_binlog_size=4096 --replicate-ignore-db=ignore_db diff -ruN base/mysql-test/rpl_transaction_test/t/rpl_transaction_001.test mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/t/rpl_transaction_001.test --- base/mysql-test/rpl_transaction_test/t/rpl_transaction_001.test 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/rpl_transaction_test/t/rpl_transaction_001.test 2007-04-27 20:14:07.000000000 -0700 @@ -0,0 +1,47 @@ +source include/master-slave.inc; + +--disable_warnings +drop table if exists t1; +create table t1(n int primary key); +drop database if exists ignore_db; +create database ignore_db; +--enable_warnings + +use test; +insert into t1 values (700); + +use ignore_db; +create table ign1(n int primary key); +let $i=70; +while ($i) +{ + eval insert into ign1 values ($i); + dec $i; +} + +use test; +insert into t1 values (701); +let $i=50; +while ($i) +{ + eval insert into t1 values ($i); + dec $i; +} + + +save_master_pos; + +connection slave; +sync_with_master; + +select count(*) from t1; +--error 1146 +select * from ign1; + +connection master; +drop table t1; +drop database ignore_db; +save_master_pos; + +connection slave; +sync_with_master; diff -ruN base/mysql-test/t/binlog.test mysql50gpl_semi_sync/mysql-test/t/binlog.test --- base/mysql-test/t/binlog.test 2007-03-05 11:40:21.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/t/binlog.test 2007-04-27 20:14:08.000000000 -0700 @@ -2,7 +2,6 @@ # misc binlogging tests that do not require a slave running # -- source include/not_embedded.inc --- source include/have_bdb.inc -- source include/have_innodb.inc --disable_warnings @@ -10,7 +9,7 @@ --enable_warnings reset master; -create table t1 (a int) engine=bdb; +create table t1 (a int) engine=innodb; create table t2 (a int) engine=innodb; begin; insert t1 values (5); diff -ruN base/mysql-test/t/rpl_semi_sync-master.opt mysql50gpl_semi_sync/mysql-test/t/rpl_semi_sync-master.opt --- base/mysql-test/t/rpl_semi_sync-master.opt 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/t/rpl_semi_sync-master.opt 2007-04-27 20:14:12.000000000 -0700 @@ -0,0 +1 @@ +--rpl_semi_sync_enabled=1 --rpl_semi_sync_timeout=1000 diff -ruN base/mysql-test/t/rpl_semi_sync-slave.opt mysql50gpl_semi_sync/mysql-test/t/rpl_semi_sync-slave.opt --- base/mysql-test/t/rpl_semi_sync-slave.opt 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/t/rpl_semi_sync-slave.opt 2007-04-27 20:14:12.000000000 -0700 @@ -0,0 +1 @@ +--rpl_semi_sync_slave_enabled=1 diff -ruN base/mysql-test/t/rpl_semi_sync.test mysql50gpl_semi_sync/mysql-test/t/rpl_semi_sync.test --- base/mysql-test/t/rpl_semi_sync.test 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/t/rpl_semi_sync.test 2007-04-30 21:37:41.000000000 -0700 @@ -0,0 +1,118 @@ +-- source include/have_innodb.inc +source include/master-slave.inc; + +connection master; +show status like 'Rpl_semi_sync_no_tx'; +show status like 'Rpl_semi_sync_yes_tx'; +show variables like 'rpl_semi_sync_enabled'; + +connection slave; +# Restart I/O thread to make sure that semi-sync is caught up. +stop slave; +show variables like 'rpl_semi_sync_slave_enabled'; +set global rpl_semi_sync_slave_enabled = 1; +start slave; +--sleep 2 + +connection master; +show status like 'Rpl_semi_sync_clients'; +--disable_warnings +drop table if exists t1; +--enable_warnings + +create table t1(n int) engine = InnoDB; +let $i=300; +while ($i) +{ + eval insert into t1 values ($i); + dec $i; +} + +show master status; +save_master_pos; + +connection slave; +sync_with_master; + +show status like 'Rpl_semi_sync_slave_status'; + +select count(distinct n) from t1; +select min(n) from t1; +select max(n) from t1; +# stop slave to let semi-sync replication fail. +stop slave; + +connection master; + +# The first semi-sync check should be on because after slave stop, +# there are no transactions on the master. +show status like 'Rpl_semi_sync_status'; +show status like 'Rpl_semi_sync_no_tx'; +show status like 'Rpl_semi_sync_yes_tx'; +show status like 'Rpl_semi_sync_clients'; + +begin; +insert into t1 values (500); +delete from t1 where n < 500; +commit; +insert into t1 values (100); +--sleep 2 + +# The second semi-sync check should be off because one transaction +# times out during waiting. +show status like 'Rpl_semi_sync_status'; +show status like 'Rpl_semi_sync_no_tx'; +show status like 'Rpl_semi_sync_yes_tx'; +save_master_pos; + +connection slave; +show status like 'Rpl_semi_sync_slave_status'; +start slave; +sync_with_master; +show status like 'Rpl_semi_sync_slave_status'; + +select count(distinct n) from t1; +select min(n) from t1; +select max(n) from t1; + +connection master; +drop table t1; +save_master_pos; + +# The third semi-sync check should be on again. +show status like 'Rpl_semi_sync_status'; +show status like 'Rpl_semi_sync_no_tx'; +show status like 'Rpl_semi_sync_yes_tx'; + +connection slave; +sync_with_master; +stop slave; + +connection master; +show master logs; +show variables like 'rpl_semi_sync_enabled'; + +# disable semi-sync on the fly +set global rpl_semi_sync_enabled=0; +show variables like 'rpl_semi_sync_enabled'; +show status like 'Rpl_semi_sync_status'; + +# enable semi-sync on the fly +set global rpl_semi_sync_enabled=1; + +connection slave; +start slave; + +connection master; +create table t1 (a int) engine = InnoDB; +drop table t1; +show status like 'Rpl_semi_sync_status'; + +connection slave; +sync_with_master; +--replace_column 2 # +show status like 'Rpl_relay%'; + +connection master; +# Test 'reset master'. +reset master; diff -ruN base/mysql-test/t/rpl_show_processlist.test mysql50gpl_semi_sync/mysql-test/t/rpl_show_processlist.test --- base/mysql-test/t/rpl_show_processlist.test 1969-12-31 16:00:00.000000000 -0800 +++ mysql50gpl_semi_sync/mysql-test/t/rpl_show_processlist.test 2007-04-27 20:14:12.000000000 -0700 @@ -0,0 +1,43 @@ +source include/master-slave.inc; + +connection master; +disable_warnings; +drop table if exists t1; +enable_warnings; +create table t1 (n int); + +let $i=300; +while ($i) +{ + eval insert into t1 values ($i); + dec $i; +} + +save_master_pos; + +connection slave; +sync_with_master; + +connection master; +--replace_column 1 # 3 # 6 # +show processlist; + +delete from t1 where n > 50; +delete from t1 where n > 25; +save_master_pos; + +connection slave; +sync_with_master; + +connection master; +drop table t1; +save_master_pos; + +connection slave; +sync_with_master; + +connection master; +--replace_column 1 # 3 # 6 # +show processlist; + +connection slave; diff -ruN base/mysys/my_thr_init.c mysql50gpl_semi_sync/mysys/my_thr_init.c --- base/mysys/my_thr_init.c 2007-03-05 11:21:21.000000000 -0800 +++ mysql50gpl_semi_sync/mysys/my_thr_init.c 2007-04-27 20:14:14.000000000 -0700 @@ -47,6 +47,8 @@ pthread_mutexattr_t my_errorcheck_mutexattr; #endif +/* Disabled because of http://bugs.mysql.com/27970 */ +#undef NPTL_PTHREAD_EXIT_BUG #ifdef NPTL_PTHREAD_EXIT_BUG /* see my_pthread.h */ /* diff -ruN base/sql/ha_innodb.cc mysql50gpl_semi_sync/sql/ha_innodb.cc --- base/sql/ha_innodb.cc 2007-03-05 11:21:41.000000000 -0800 +++ mysql50gpl_semi_sync/sql/ha_innodb.cc 2007-04-28 11:11:30.000000000 -0700 @@ -43,6 +43,7 @@ #define MAX_ULONG_BIT ((ulong) 1 << (sizeof(ulong)*8-1)) #include "ha_innodb.h" +#include "repl_semi_sync.h" pthread_mutex_t innobase_share_mutex, /* to protect innobase_open_files */ prepare_commit_mutex; /* to force correct commit order in @@ -175,6 +176,8 @@ my_bool innobase_rollback_on_timeout = FALSE; my_bool innobase_create_status_file = FALSE; +extern ReplSemiSync semi_sync_replicator; + static char *internal_innobase_data_file_path = NULL; /* The following counter is used to convey information to InnoDB @@ -773,10 +776,8 @@ if (trx == NULL) { DBUG_ASSERT(thd != NULL); - trx = trx_allocate_for_mysql(); + trx = ha_innobase::allocate_trx(thd, &((*thd).query)); - trx->mysql_thd = thd; - trx->mysql_query_str = &(thd->query); trx->active_trans = 0; /* Update the info whether we should skip XA steps that eat @@ -1682,9 +1683,15 @@ if (trx->active_trans == 2) { pthread_mutex_unlock(&prepare_commit_mutex); - } - trx->active_trans = 0; + trx->active_trans = 0; + + ha_commit_complete(thd); + } else { + + trx->active_trans = 0; + + } } else { /* We just mark the SQL statement ended and do not do a @@ -1744,14 +1751,25 @@ ut_a(trx != NULL); - trx->mysql_log_file_name = log_file_name; - trx->mysql_log_offset = (ib_longlong)end_offset; - - trx->flush_log_later = TRUE; - - innobase_commit(thd, TRUE); - - trx->flush_log_later = FALSE; + if (semi_sync_replicator.getMasterEnabled()) { + /* Let us store the binlog file name and the position, so that + we know how long to wait for the binlog to the replicated to + the slave in synchronous replication. */ + + if (trx->repl_wait_binlog_name == NULL) { + trx->repl_wait_binlog_name = + (char*)mem_alloc_noninline(FN_REFLEN + 100); + } + + ut_a(strlen(log_file_name) <= FN_REFLEN + 100); + strcpy(trx->repl_wait_binlog_name, + log_file_name + dirname_length(log_file_name)); + trx->repl_wait_binlog_pos = (ib_longlong)end_offset; + + /* Store transaction ending position for semi-sync replication. */ + semi_sync_replicator.writeTranxInBinlog( + trx->repl_wait_binlog_name, end_offset); + } return(0); } @@ -1803,16 +1821,13 @@ trx = (trx_t*) thd->ha_data[innobase_hton.slot]; - if (trx && trx->active_trans) { - - trx->active_trans = 0; - - if (UNIV_UNLIK