List:Commits« Previous MessageNext Message »
From:Serge Kozlov Date:January 26 2010 12:56pm
Subject:bzr commit into nuts branch (Serge.Kozlov:367) Bug#31502
View as plain text  
#At file:///home/ksm/sun/repo/bug31502/nuts/ based on revid:serge.kozlov@stripped

  367 Serge Kozlov	2010-01-26
      Cumulative patch:
      1. Added test case for Bug#31502
      2. Fix version detecting for MySQL server.
      3. Sorting of combinations for data types test cases.
      added:
        suites/bugs/bug31502.pm
      modified:
        lib/My/Nuts/util/mysql.pm
        suites/rep/data_types/data_types_eq.pm
        suites/rep/data_types/data_types_main.pm

=== modified file 'lib/My/Nuts/util/mysql.pm'
--- a/lib/My/Nuts/util/mysql.pm	2009-06-09 15:58:26 +0000
+++ b/lib/My/Nuts/util/mysql.pm	2010-01-26 12:55:57 +0000
@@ -42,7 +42,7 @@ sub mysqld_build_info
       return $build;
     }
 
-    open( OUTPUT, "$mysqld -V 2>&1 |" ) || return $build;
+    open( OUTPUT, "$mysqld --verbose --help 2>&1 |" ) || return $build;
     while (<OUTPUT>)
     {
         if (/.*mysqld.*Ver .*/)

=== added file 'suites/bugs/bug31502.pm'
--- a/suites/bugs/bug31502.pm	1970-01-01 00:00:00 +0000
+++ b/suites/bugs/bug31502.pm	2010-01-26 12:55:57 +0000
@@ -0,0 +1,72 @@
+package bugs::bug31502;
+use Exporter;
+our @ISA = qw(Exporter My::Nuts::Library::Tests::Replication);
+use strict;
+use warnings;
+use My;
+use My::Nuts::Library::Kernel::Server;
+use My::Nuts::Library::Kernel::ServerResult;
+use My::Nuts::Library::Kernel::Manager;
+use My::Nuts::Library::Kernel::Result;
+use My::Nuts::Library::Tests::Replication;
+use My::Nuts::Library::Kernel::Replication;
+use Test::More;
+
+sub prepare
+{
+    return;
+}
+
+sub startup
+{
+    return;
+}
+
+sub fire
+{
+    my ($test) = @_;
+    # Setup topology, start server, create test db
+    my ($master, $slave) = ok_servers($test, 
+	"master(--binlog-format=row)->slave(--binlog-format=row)",
+	"master:create_db_test");    
+    
+    plan tests => 8;
+
+    # Bug code
+    ok_sql ( $master, "CREATE TABLE t1 (a CHAR(20), b FLOAT DEFAULT '2.00')");
+    ok_synchronize ( $master, $slave );
+    ok_sql ( $slave, "ALTER TABLE t1 DROP b");
+    ok_sql ( $master, "INSERT INTO t1 VALUES('xxxxxxxxxx', 1.0)");
+    ok_synchronize ( $master, $slave );
+    ok( retrieve_slave_status($slave, "Slave_SQL_Running") eq "Yes", "Check status of slave SQL thread");
+    my $rs = ok_sql( $slave, "SELECT a FROM t1");
+    if ( !is_error($rs) )
+    {
+	my @rs_data = get_next($rs);
+	if ( defined ($rs_data[0]) )
+	{
+	    ok ( $rs_data[0] eq "xxxxxxxxxx", "Check value a on slave");
+	    diag("Expected: 'xxxxxxxxxx'");
+	    diag("Got: '" . $rs_data[0] . "'");
+	}
+    }
+}
+
+sub shutdown
+{
+    return;
+}
+
+1;
+__END__;
+
+=head1 NAME
+
+bugs::bug31502
+
+Bug#31502 5.1.20 -> 5.1.22 Slave crashes if it gets an event w/ data for non-exist column
+
+=head1 SYNOPSIS
+
+Test case for Bug#31502
+

=== modified file 'suites/rep/data_types/data_types_eq.pm'
--- a/suites/rep/data_types/data_types_eq.pm	2010-01-19 17:15:01 +0000
+++ b/suites/rep/data_types/data_types_eq.pm	2010-01-26 12:55:57 +0000
@@ -27,7 +27,7 @@ sub combinations
     my @test_combinations = ();
     foreach my $binlog ( sort keys %binlog_formats )
     {
-	foreach my $data_type ( keys %{ get_data_types() } )
+	foreach my $data_type ( sort keys %{ get_data_types() } )
 	{
 	    $data_type =~ s/(\(|\))//g;
 	    $data_type =~ s/ /_/g;

=== modified file 'suites/rep/data_types/data_types_main.pm'
--- a/suites/rep/data_types/data_types_main.pm	2010-01-19 17:15:01 +0000
+++ b/suites/rep/data_types/data_types_main.pm	2010-01-26 12:55:57 +0000
@@ -25,7 +25,7 @@ my %decoded = ();
 sub combinations
 {
     my @test_combinations = ();
-    foreach my $binlog ( keys %binlog_formats )
+    foreach my $binlog ( sort keys %binlog_formats )
     {
 	foreach my $data_type ( sort keys %{ get_data_types() } )
 	{

Thread
bzr commit into nuts branch (Serge.Kozlov:367) Bug#31502Serge Kozlov26 Jan