List:Commits« Previous MessageNext Message »
From:Serge Kozlov Date:November 23 2009 8:25pm
Subject:bzr push into nuts branch (Serge.Kozlov:360 to 361)
View as plain text  
  361 Serge Kozlov	2009-11-23
      Optimization of combinations for replication test cases in NUTS:
      1. Removed incorrect combinations like A->row->B-stmt->C
      2. Set binlog format for both global/session variables.
      renamed:
        suites/rep/client_redirect.pm => suites/rep/client_redirect/client_redirect.pm
      modified:
        suites/rep/chained_diff_engine.pm
        suites/rep/hot_standby.pm
        suites/rep/semisync.pm
        suites/rep/client_redirect/client_redirect.pm

  360 Serge Kozlov	2009-11-15
      WL#5062, postfix for test case for data types with defined size
      modified:
        suites/rep/diff_table_def.pm

=== modified file 'suites/rep/chained_diff_engine.pm'
--- a/suites/rep/chained_diff_engine.pm	2009-11-11 21:11:22 +0000
+++ b/suites/rep/chained_diff_engine.pm	2009-11-23 20:24:20 +0000
@@ -29,6 +29,9 @@ sub combinations
     {
         foreach my $comb2 (@combinations)
         {
+            # Skip cases when replication can not work properly
+    	    next if ($comb1 eq "row" && $comb2 ne "row");
+            next if ($comb1 eq "mixed" && $comb2 eq "stmt");
             push (@pairs, "$comb1-$comb2");
         }
     }
@@ -137,13 +140,17 @@ sub fire
 	}	
       }	
     }
-    plan tests => scalar(@$data) + 2;
+    plan tests => scalar(@$data) + 6;
     sql ($slave, "DROP DATABASE " . $dbname);    
 
     # Setup topology	
-    ok_sql ( $master, "SET BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[0]} . "'");
+    ok_sql ( $master, "SET GLOBAL BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[0]} . "'");
+    ok_sql ( $master, "SET SESSION BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[0]} . "'");
+    ok_sql ( $master_middle, "SET GLOBAL BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[1]} . "'");
+    ok_sql ( $master_middle, "SET SESSION BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[1]} . "'");
     attach ( $master, $master_middle );
-    ok_sql ( $master_middle, "SET BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[1]} . "'");
+    ok_sql ( $slave, "SET GLOBAL BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[1]} . "'");
+    ok_sql ( $slave, "SET SESSION BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[1]} . "'");
     attach ( $master_middle, $slave );
 
     # Main loop of test: run all statements

=== renamed file 'suites/rep/client_redirect.pm' => 'suites/rep/client_redirect/client_redirect.pm'
--- a/suites/rep/client_redirect.pm	2009-11-11 21:11:22 +0000
+++ b/suites/rep/client_redirect/client_redirect.pm	2009-11-23 20:24:20 +0000
@@ -1,4 +1,4 @@
-package rep::client_redirect;
+package rep::client_redirect::client_redirect;
 use Exporter;
 our @ISA = qw(Exporter My::Nuts::Library::Tests::SimpleTest);
 use strict;
@@ -31,7 +31,10 @@ sub combinations
     {
         foreach my $comb2 (@combinations)
         {
-            push (@pairs, "$comb1-$comb2");
+    	    # Skip cases when replication can not work properly
+    	    next if ($comb1 eq "row" && $comb2 ne "row");
+    	    next if ($comb1 eq "mixed" && $comb2 eq "stmt");
+    	    push (@pairs, "$comb1-$comb2");
         }
     }
     return @pairs;
@@ -76,12 +79,16 @@ sub fire
     $dump_file = undef;
     
     # Set test plan
-    plan tests => scalar(@$data) + 22;
+    plan tests => scalar(@$data) + 26;
 
     # Setup topology
-    ok_sql ( $master, "SET BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[0]} . "'");
+    ok_sql ( $master, "SET GLOBAL BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[0]} . "'");
+    ok_sql ( $master, "SET SESSION BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[0]} . "'");
+    ok_sql ( $master_middle, "SET GLOBAL BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[1]} . "'");
+    ok_sql ( $master_middle, "SET SESSION BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[1]} . "'");
     attach ( $master, $master_middle );
-    ok_sql ( $master_middle, "SET BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[1]} . "'");
+    ok_sql ( $slave, "SET GLOBAL BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[1]} . "'");
+    ok_sql ( $slave, "SET SESSION BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[1]} . "'");
     attach ( $master_middle, $slave );
     
     # Initialization

=== modified file 'suites/rep/hot_standby.pm'
--- a/suites/rep/hot_standby.pm	2009-11-11 21:11:22 +0000
+++ b/suites/rep/hot_standby.pm	2009-11-23 20:24:20 +0000
@@ -30,6 +30,9 @@ sub combinations
     {
 	foreach my $comb2 (@combinations)
 	{
+	    # Skip cases when replication can not work properly
+	    next if ($comb1 eq "row" && $comb2 ne "row");
+	    next if ($comb1 eq "mixed" && $comb2 eq "stmt");
 	    push (@pairs, "$comb1-$comb2");
 	}
     }
@@ -58,11 +61,16 @@ sub fire
     my $data = get_data_from_source();
     
     # summarize number of statements and ok_* command in test
-    plan tests => scalar(@$data) + 20;
+    plan tests => scalar(@$data) + 26;
 
     # Setup topology
+    ok_sql ( $master, "SET GLOBAL BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[0]} . "'");
+    ok_sql ( $master, "SET SESSION BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[0]} . "'");
+    ok_sql ( $master_extra, "SET GLOBAL BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[0]} . "'");
+    ok_sql ( $master_extra, "SET SESSION BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[0]} . "'");
+    ok_sql ( $slave, "SET GLOBAL BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[0]} . "'");
+    ok_sql ( $slave, "SET SESSION BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[0]} . "'");
     attach ( $master, $slave );
-    ok_sql ( $master, "SET BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[0]} . "'");
     attach ( $master, $master_extra );
 
     # Initial workload
@@ -123,7 +131,8 @@ sub fire
 
     # Start B->C, stop A
     attach ( $master_extra, $slave, $master_extra_file, $master_extra_pos );
-    ok_sql ( $master_extra, "SET BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[1]} . "'");
+    ok_sql ( $master_extra, "SET GLOBAL BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[1]} . "'");
+    ok_sql ( $master_extra, "SET SESSION BINLOG_FORMAT= '" . $decode_combination{$binlog_formats[1]} . "'");
     stop_server ($master);
 
     # Check that B and C have same data

=== modified file 'suites/rep/semisync.pm'
--- a/suites/rep/semisync.pm	2009-11-11 21:11:22 +0000
+++ b/suites/rep/semisync.pm	2009-11-23 20:24:20 +0000
@@ -115,7 +115,10 @@ sub main_test
 	    $cur_servers->{$pair}->{"slave"} = $servers->{$2};
 	    if (defined $mode)
 	    {
-		sql($cur_servers->{$pair}->{"master"}, "SET BINLOG_FORMAT='$binlog_format';");
+		sql($cur_servers->{$pair}->{"master"}, "SET GLOBAL BINLOG_FORMAT='$binlog_format';");
+		sql($cur_servers->{$pair}->{"master"}, "SET SESSION BINLOG_FORMAT='$binlog_format';");
+		sql($cur_servers->{$pair}->{"slave"}, "SET GLOBAL BINLOG_FORMAT='$binlog_format';");
+		sql($cur_servers->{$pair}->{"slave"}, "SET SESSION BINLOG_FORMAT='$binlog_format';");
 		attach($cur_servers->{$pair}->{"master"}, $cur_servers->{$pair}->{"slave"});
 		ok_wait_start_replication($cur_servers->{$pair}->{"slave"});
 	    }

Thread
bzr push into nuts branch (Serge.Kozlov:360 to 361) Serge Kozlov23 Nov