List:Commits« Previous MessageNext Message »
From:Alfranio Correia Date:May 18 2009 2:56pm
Subject:Re: bzr commit into nuts branch (Serge.Kozlov:318) WL#4840 WL#4845
WL#4846
View as plain text  
Hi Serge,

the patch looks good.
Just a few question before I approve it.

Cheers.

Serge Kozlov wrote:
> #At file:///home/ksm/sun/repo/WL4840/nuts/ based on
> revid:alfranio.correia@stripped
>
>   318 Serge Kozlov	2009-05-15
>       WL#4840, WL#4845, WL#4846:
>       -- replaced XML format by storable file
>       -- HTML report of data type matrix
>       -- config file
>       -- different modes of test execution
>       -- bug fixes and improvements
>       added:
>         suites/rep/data_types/
>         suites/rep/data_types.pm
>         suites/rep/data_types/config.pl
>         suites/rep/data_types/data_types.conf
>         suites/rep/data_types/data_types_matrix
>
> === added directory 'suites/rep/data_types'
> === added file 'suites/rep/data_types.pm'
> --- a/suites/rep/data_types.pm	1970-01-01 00:00:00 +0000
> +++ b/suites/rep/data_types.pm	2009-05-14 21:04:11 +0000
> @@ -0,0 +1,570 @@
> +package rep::data_types;
> +use Exporter;
> +our @ISA = qw(Exporter My::Nuts::Library::Tests::SimpleTest);
> +use strict;
> +use warnings;
> +use My::Nuts::Library::Kernel::Server;
> +use My::Nuts::Library::Kernel::Manager;
> +use My::Nuts::Library::Kernel::Result;
> +use My::Nuts::Library::Tests::SimpleTest;
> +use My::Nuts::Library::Kernel::Replication;
> +use Test::More;
> +use Storable;
> +
> +# Test configuration
> +require "data_types/config.pl";
> +
> +# Internal variables
> +our $types = {};
> +our $matrix = [];
> +our $errors = {};
> +our $master_options = [];
> +our $slave_options = [];
> +our $matrix_orig = {};
> +our $matrix_cur = {};
> +our $counter= 1;
> +
> +sub prepare
> +{
> +    get_error_msgs($rep::data_types::config::error_messages_file);
> +    $matrix_orig= retrieve($rep::data_types::config::matrix_file) unless (!-e
> $rep::data_types::config::matrix_file);
> +    prepare_matrix($rep::data_types::config::data_types_config_file);
> +    report_matrix($matrix_orig, $rep::data_types::config::matrix_report_file .
> ".orig.html");
> +    prepare_options($rep::data_types::config::server_options, "master",
> $master_options);
> +    prepare_options($rep::data_types::config::server_options, "slave",
> $slave_options);
> +    vprint(1, "\nFound " . scalar(@$matrix) . " combinations, extended with server
> options to " . (scalar(@$matrix) * scalar(@$master_options) * scalar(@$slave_options)) .
> "\n");
> +    return;
> +}
> +
> +sub startup
> +{
> +    return;
> +}
> +
> +sub fire
> +{
> +    my ($test) = @_;
> +    my $master = server ($test);
> +    my $slave   = server ($test);
> +    my $dbname  = "test";
> +    plan tests => 1;
> +    
> +    # Setup topology
> +    attach ( $master, $slave );
> +
> +    # Initial workload
> +    ok_sql ( $master, "CREATE DATABASE IF NOT EXISTS " . $dbname );
> +    ok_sql ( $master, "USE " . $dbname );
> +    ok_sql ( $slave, "USE " . $dbname );
> +    foreach my $opt_set_from (@$master_options)
> +    {	
> +        foreach my $opt_set_to (@$slave_options)
> +    	{
> +    	    vprint(1, localtime() . " Master options: " . join(" ", values
> %$opt_set_from) . ", Slave options: " . join(" ", values %$opt_set_to) . "
> ($counter)\n");
> +	    run_matrix($master, $slave, $opt_set_from, $opt_set_to);
> +	    store_matrix($matrix_cur, $rep::data_types::config::matrix_file);
Should we preserve the matrix_file?
> 	    
> +	}	
> +    }
> +    store_matrix($matrix_cur, $rep::data_types::config::matrix_file);
>   
See above.
> +    report_matrix($matrix_cur, $rep::data_types::config::matrix_report_file .
> ".cur.html");
> +}
>   

Find other comments in-line.
> +
> +sub prepare_options()
> +{
> +    my $server_options= shift;
> +    my $filter= shift;
> +    my $opts= shift;
> +    my $option_num= 1;
> +    my $diva= {};
> +    my $cur_val;
> +    foreach my $option (@{$server_options})
> +    {
> +	if ($option->{"affected"} =~ m/$filter/)
> +	{
> +    	    $diva->{$option->{"name"}}= $option_num;
> +    	    $option_num= $option_num * scalar( @{$option->{"values"}} );
> +    	}
> +    }
> +    for (my $i = 0; $i < $option_num; $i++)
> +    {
> +	$cur_val= $i;
> +	my $opt= {};
> +	foreach my $option (reverse @{$server_options})
> +	{
> +	    if ($option->{"affected"} =~ m/$filter/)
> +	    {
> +		my $k= int($cur_val/$diva->{$option->{"name"}});
> +		if ($diva->{$option->{"name"}} == 1)
> +		{
> +		    $k= $cur_val % scalar( @{$option->{"values"}} );
> +		}
> +		$opt->{$option->{"name"}}= $option->{"values"}->[$k];
> +		$cur_val= $cur_val % $diva->{$option->{"name"}};	    
> +	    }
> +	}
> +	push(@$opts, $opt);
> +    }
> +}
> +
> +
> +sub run_matrix()
> +{
> +    my ($master, $slave, $option_set_from, $option_set_to)= @_;
> +    my $test_error;
> +    my $test_desc;
> +    my $slave_query;
> +    my $rs;
> +    my @rs_data= ();
> +    my $matrix_key;
> +    my $engine_from= " ENGINE=" . $option_set_from->{"engine"};
> +    my $engine_to= " ENGINE=" . $option_set_to->{"engine"};
> +    # Run tests for each pair from matrix
> +    my $err;    
> +    my $need_restart_rep= 0;
> +    my $skip_pair= 0;
> +    ok_sql ( $master, "SET BINLOG_FORMAT='" . $option_set_from->{"binlog_format"}
> . "'" );
> +    foreach my $pair (@$matrix)
> +    {
> +	my $type_from= $pair->{"from"};
> +	my $type_to= $pair->{"to"};
> +	my $values_from= $pair->{"values_from"};
> +	$matrix_key = matrix_key($option_set_from, $option_set_to, $type_from, $type_to);	
> +	if ($rep::data_types::config::mode eq "eq" && $type_from ne $type_to)
> +	{
> +	    $counter++;
> +	    next;	
> +	}
> +	elsif ($rep::data_types::config::mode =~ m/^fix_error\:(.+)/)
> +	{
> +	    if ($matrix_orig->{$matrix_key}->{"result"} ne $1)
> +	    {
> +    		$matrix_cur->{$matrix_key}= $matrix_orig->{$matrix_key};
> +    		$counter++;
> +		next;
> +	    }	
> +	}
> +	elsif ($rep::data_types::config::record == 2 &&
> $matrix_orig->{$matrix_key} && $rep::data_types::config::mode eq "")
> +	{
> +	    $matrix_cur->{$matrix_key}= $matrix_orig->{$matrix_key};
> +	    $counter++;
> +	    next;
> +	}
> +    	my $test_info= "$type_from -> $type_to";
> +	if ($need_restart_rep == 1)
> +	{
> +	    stop_replication($slave);
> +	    reset_master($master);
> +	    reset_slave($slave);
> +	    attach($master, $slave);
> +	    ok_wait_start_replication($slave, 0.1);
> +	    $need_restart_rep= 0;
> +	}
> +	if ($types->{$pair->{"from_orig"}}->{"engines"})
> +	{
> +	    if ( join(",", @{$types->{$pair->{"from_orig"}}->{"engines"}}) !~
> qr/$option_set_from->{"engine"}/i)
> +	    {
> +		$skip_pair= 1;
> +		$test_desc= "Engine " . $option_set_from->{"engine"} . " on master does not
> support type $type_from";		
> +		$test_error= "TER_MASTER_ENGINE_WRONG_TYPE";
> +	    }    	    
> +	}
> +	if ($types->{$pair->{"to_orig"}}->{"engines"})
> +	{
> +	    if ( join(",", @{$types->{$pair->{"to_orig"}}->{"engines"}}) !~
> qr/$option_set_to->{"engine"}/i)
> +	    {
> +		$skip_pair= 1;
> +		$test_desc= "Engine " . $option_set_to->{"engine"} . " on slave does not
> support type $type_to";		
> +		$test_error= "TER_SLAVE_ENGINE_WRONG_TYPE";
> +	    }    	    
> +	}
> +	if ($skip_pair == 0)
> +	{
> +	    ok_sql ( $master, "DROP TABLE IF EXISTS t_test,t_orig;" );
> +	    ok_sql ( $master, "CREATE TABLE t_test (col_num INT NOT NULL, col_test
> $type_from, col_info VARCHAR(250)) $engine_from;" );	        
> +	    ok_sql ( $master, "CREATE TABLE t_orig (col_num INT NOT NULL, col_test
> $type_from, col_info VARCHAR(250)) $engine_from;" );	        
> +	    $rs= sql( $master, "SHOW CREATE TABLE t_test;" );	        
> +	    @rs_data= get_next($rs);
> +	    if ($rs_data[1] !~ qr/$engine_from/i)
> +	    {
> +		$_= $rs_data[1];
> +		s/\n//g;
> +	        vprint(1, "... unable to set $engine_from on master: $_\n");
> +		$counter++;
> +	    }	
> +	    ok_synchronize ( $master, $slave );
> +	    ok_sql ( $slave, "DROP TABLE IF EXISTS t_test,t_conv;" );	        
> +	    ok_sql ( $slave, "CREATE TABLE t_test (col_num INT NOT NULL, col_test $type_to,
> col_info VARCHAR(250)) $engine_to;" );	        
> +	    ok_sql ( $slave, "CREATE TABLE t_conv (col_num INT NOT NULL, col_test
> $type_from, col_info VARCHAR(250)) $engine_from;" );	        
> +	    $rs= sql( $slave, "SHOW CREATE TABLE t_test;" );	        
> +	    @rs_data= get_next($rs);
> +	    if ($rs_data[1] !~ qr/$engine_to/i)
> +	    {
> +		$_= $rs_data[1];
> +		s/\n//g;
> +	        vprint(1, "$counter ERROR:    $test_info\n    unable to set $engine_to on
> slave: $_\n");
> +		$counter++;
> +		exit;
> +		next;
> +	    }	
> +	    my $test_ok= 1;
> +	    $test_error= "";
> +	    if ($types->{$pair->{"from_orig"}}->{"query_before"})
> +	    {
> +		ok_sql ( $master, $types->{$pair->{"from_orig"}}->{"query_before"}.";"
> );
> +	    }
> +	    # create inserts
> +	    my $i= 1;
> +	    foreach my $test_value (@$values_from)
> +	    {
> +		sql ( $master, "INSERT INTO t_test VALUES ($i, $test_value, \"$counter. $i.
> $type_from -> $type_to\");");				
> +		sql ( $master, "INSERT INTO t_orig VALUES ($i, $test_value, \"$counter. $i.
> $type_from -> $type_to\");");				
> +		$i++;
> +	    }
> +	    $err= 0;
> +	    synchronize ( $master, $slave );
> +	    my $sync= sync($master, $slave);
> +	    if ($sync == 0)
> +	    {
> +		$rs= sql ($slave, "SELECT COUNT(*) FROM t_test;");
> +		@rs_data= get_next($rs);
> +		if ($rs_data[0] == scalar(@$values_from))
> +		{
> +		    # convert data
> +		    ok_sql ( $slave, "INSERT INTO t_conv (SELECT * FROM t_test);" );				    		
> +		    $i= 1;
> +		    foreach my $test_value (@$values_from)
> +		    {		    
> +			if ($test_value =~ m/NULL/)
> +			{
> +			    $slave_query= "SELECT COUNT(*) FROM t_orig,t_conv WHERE t_orig.col_num =
> t_conv.col_num AND t_orig.col_num = $i AND t_orig.col_test IS NULL AND t_conv.col_test IS
> NULL;";	
> +			}
> +			else
> +			{
> +    			    $slave_query= "SELECT COUNT(*) FROM t_orig,t_conv WHERE t_orig.col_num =
> t_conv.col_num AND t_orig.col_num = $i AND t_orig.col_test = t_conv.col_test";	
> +    			}
> +    			$rs= sql ($slave, $slave_query);
> +    			if ( !is_error($rs) )
> +    			{    			
> +        		    @rs_data= get_next($rs);
> +    			    if ($rs_data[0])
> +    			    {
> +    				if ($rs_data[0] == 0)
> +    				{
> +    				    $test_ok= 0;
> +    				    $test_error= "TER_DATA_NOT_EQ";    				
> +    				    $test_desc= "Data for row $i is not equal";    				
> +    				}
> +    			    }
> +    			    else
> +    			    {
> +    				$test_ok= 0;
> +    				$test_error= "TER_NO_DATA";
> +    				$test_desc= "No data for row $i ($test_value)";    				    				
> +    			    }
> +			}
> +    			else
> +    			{
> +    			    $test_ok= 0;    		    
> +    			    $test_error= $errors->{get_errors_code($rs)};    		
> +    			    $test_desc= "Error for query $slave_query";    				
> +    			}   	    
> +    			$i++;
> +		    }
> +		}
> +		else
> +		{
> +		    # not replicated
> +		    $test_ok= 0;
> +		    $test_error= "TER_WRONG_ROW_NUM";
> +    		    $test_desc= "Some rows are not replicated (" . $rs_data[0] . "/" .
> scalar(@$values_from) . ")";    				    		    
> +		}
> +	    }
> +	    else
> +	    {
> +		# not sync
> +    		$test_ok= 0;
> +    		$err= retrieve_slave_status($slave, "Last_SQL_Errno");
> +    		if ($err =~ /[0-9]{2,4}/)
> +    		{
> +    	    	    $test_error= $errors->{$err};
> +    		    $test_desc= "Slave SQL thread stopped with error";    				
> +    		}
> +    		else
> +    		{
> +    	    	    $test_error= "TER_SYNC";
> +    		    $test_desc= "Slave are not synchronized with master";    				
> +    		}
> +    		$need_restart_rep= 1;
> +	    }	    
> +	    if ($test_ok == 1)
> +    	    {
> +    		vprint(2, "$counter OK:   $test_info\n");
> +    		$matrix_cur->{$matrix_key}->{"result"} =  "OK";
> +    	    }    
> +    	    else
> +    	    {
> +    		vprint(2, "$counter $test_error:   $test_info\n");
> +    		$matrix_cur->{$matrix_key}->{"result"} =  $test_error;
> +    		#$matrix_cur->{$matrix_key}->{"description"} =  $test_desc;
> +    	    }
> +    	}
> +    	else
> +    	{
> +    	    vprint(2, "$test_error:   $test_info\n");
> +    	    $matrix_cur->{$matrix_key}->{"result"}= $test_error;
> +    	    #$matrix_cur->{$matrix_key}->{"description"} =  $test_desc;
> +    	    $skip_pair= 0;
> +    	}
> +    	if (defined $matrix_cur->{$matrix_key}->{"result"} && defined
> $matrix_orig->{$matrix_key}->{"result"})
> +    	{
> +    	    if ($matrix_cur->{$matrix_key}->{"result"} ne
> $matrix_orig->{$matrix_key}->{"result"})
> +    	    {
> +    		vprint(1, "$counter DIFF:   $test_info\n    expected:" .
> $matrix_orig->{$matrix_key}->{"result"} . "    got:" .
> $matrix_cur->{$matrix_key}->{"result"} . "\n") unless
> ($rep::data_types::config::record > 0);    	    
> +    		exit;
> +    	    }
> +    	}
> +    	else
> +    	{
> +    	    vprint(1, "$counter DIFF_NO_DATA:   $test_info\n") unless
> ($rep::data_types::config::record > 0);    	    
> +    	}
> +    	$counter++;
> +    }
> +}
> +
> +sub prepare_matrix()
> +{
> +    my $config_file= shift;
> +    # Read config files with definitions for data types
> +    my $types_null = ["NULL", "NOT NULL"];
> +    my $section;
> +    open F, $config_file or exit_from_test (1, "Could not open configuration file
> \"$config_file\"");
> +    while(<F>)
> +    {
> +	if (/^\#.*$/)
> +	{
> +	    next;
> +	}
> +	elsif (/\[(.+)\]/)
> +	{
> +	    $section= "$1";
> +	}
> +	elsif (/^values *\:\ *(.+\,.+)/)
> +	{
> +	    $types->{$section}->{"values"}= [(split /\,\ +/, $1)];
> +	}
> +	elsif (/^size *\:\ *(.+\.\..+)/)
> +	{
> +	    $types->{$section}->{"size"}= [(split /\ *\.\.\ */, $1)];
> +	}
> +	elsif (/^(query_before|group)\ *\:\ *(.+)/)
> +	{
> +	    $types->{$section}->{$1}= $2;
> +	}	
> +	elsif (/^([a-z\_A-Z]+)\ *\:\ *(.+\,.+)/)
> +	{
> +	    $types->{$section}->{$1}= [(split /\,\ */, $2)];
> +	}	
> +	elsif (/^([a-z\_A-Z]+)\ *\:\ *(.+)/)
> +	{
> +	    $types->{$section}->{$1}= [$2];
> +	}	
> +    }
> +    close F;
> +    # Generate matrix
> +    foreach my $type_from (sort keys %$types)
> +    {
> +        foreach my $type_to (sort keys %$types)
> +	{	
> +	    foreach my $null_from ( @$types_null )
> +	    {
> +		foreach my $null_to ( @$types_null )
> +		{
> +		    my @values_from = @{$types->{$type_from}->{"values"}};
> +		    if ($null_from =~ m/^NULL$/)
> +		    {
> +			unshift(@values_from, "NULL");
> +		    }
> +		    my @values_to = @{$types->{$type_to}->{"values"}};
> +		    if ($null_to =~ m/^NULL$/)
> +		    {
> +			unshift(@values_to, "NULL");
> +		    }			
> +		    my $ext_from= "$type_from $null_from";
> +		    $ext_from=~s/\ {2,10}//g;
> +		    $ext_from=~s/\ *$//g;
> +		    my $ext_to= "$type_to $null_to";
> +		    $ext_to=~s/\ {2,10}//g;
> +		    $ext_to=~s/\ *$//g;
> +		    push(@$matrix, {"from_orig"=> $type_from, "to_orig"=> $type_to,
> "from"=> $ext_from, "to"=> $ext_to, "values_from"=> [@values_from],
> "values_to"=> [@values_to]});		
> +		    my $last= scalar(@$matrix) - 1;
> +		}
> +	    }	    	
> +	}
> +    }
> +}
> +
> +sub get_error_msgs()
> +{
> +    my $errfile= shift;
> +    open F, $errfile or exit_from_test (1, "Could not open file \"$errfile\"");
> +    my $start_error_number;
> +    while(<F>)
> +    {
> +	if (m/start-error-number +(\d+)/)
> +	{
> +	    $start_error_number= $1;
> +	}
> +	elsif (m/^((ER|WARN)[A-Za-z0-9_\-]+)/)
> +	{
> +	    $errors->{$start_error_number}= $1;
> +	    $errors->{$start_error_number}=~ s/\s+$//;
> +	    $start_error_number++;
> +	}
> +    }
> +    close F;
> +    
> +}
> +
> +sub vprint()
> +{
> +    my $vmode= shift;
> +    my $text= shift;
> +    if ($rep::data_types::config::verbose >= $vmode) 
> +    {
> +	print $text;
> +    }
> +}
> +
> +sub sync()
> +{
> +    my ($master,$slave)= @_;
> +    if (
> +	(retrieve_master_status($master, "Position") eq retrieve_slave_status($slave,
> "Exec_Master_Log_Pos")) &&
> +	(retrieve_slave_status($slave, "Slave_IO_Running") =~ m/yes/i) &&
> +	(retrieve_slave_status($slave, "Slave_SQL_Running") =~ m/yes/i))
> +    {
> +	return 0;
> +    }
> +    else
> +    {
> +	return 1;
> +    }
> +}
> +
> +sub matrix_key()
> +{
> +    my ($opt_from, $opt_to, $type_from, $type_to) = @_;
> +    my $opt_name;
> +    my $matrix_key = "master:[type=" . $type_from . ",";
> +    foreach $opt_name ( sort keys %$opt_from)
> +    {
> +	$matrix_key .= "$opt_name=" . $opt_from->{$opt_name} . ",";
> +    }
> +    $matrix_key =~ s/\,$//;
> +    $matrix_key .= "];slave:[type=" . $type_to . ",";;
> +    foreach $opt_name ( sort keys %$opt_to)
> +    {
> +	$matrix_key .= "$opt_name=" . $opt_to->{$opt_name} . ",";
> +    }
> +    $matrix_key =~ s/\,$//;
> +    $matrix_key .= "]";
> +    return lc $matrix_key;
> +}
> +
> +sub store_matrix()
> +{
> +    my ($mref, $filename)= @_;
> +    $mref->{"info"}->{"created"}= localtime(); 
> +    if ( $rep::data_types::config::record > 0 || (! -e $filename))
> +    {
> +	store($mref, $filename);
> +    }
> +}
> +
> +sub report_matrix()
> +{
> +    my ($mref, $filename)= @_;
> +    my $r_matrix = {};
> +    my $opt;
> +    my $t_from;
> +    my $t_to;
> +    my $html_out = "<html>\n<head><title>Data type
> matrix</title></head><body>\nReport created by
> ".$mref->{"info"}->{"created"}."<br>\n";
> +    $html_out .= "ER_* - MySQL error messages, TER_* - errors in test: data
> replicated but invalid<br>\r";
> +    # repack matrix
> +    foreach my $key ( keys %$mref )
> +    {
> +	if ($key =~ m/^master\:\[type\=([0-9a-z ()]+)\,*.*\];slave\:\[type\=([0-9a-z
> ()]+)\,*.*\]$/)
> +	{
> +	    $t_from= $1;
> +	    $t_to= $2;
> +	    $opt= $key;
> +	    $opt=~ s/type\=[0-9a-z ()]+\,//g;
> +	    $r_matrix->{$opt}->{$t_from}->{$t_to}=
> $mref->{$key}->{"result"};	    
> +	}
> +    }
> +    foreach $opt ( keys %$r_matrix)
> +    {
> +	$html_out .= "<h3>$opt</h3>\n<table
> border=1><tr>\n\t<td></td>\n";
> +	foreach $t_from ( sort keys %{$r_matrix->{$opt}} )
> +	{
> +	    $html_out .= "\t<td><b>$t_from</b></td>\n";
> +	}
> +	$html_out .= "</tr>\n";
> +	foreach $t_from ( sort keys %{$r_matrix->{$opt}} )
> +	{	
> +	    $html_out .=
> "<tr>\n\t<td><b>$t_from</b></td>\n";
> +	    foreach $t_to ( sort keys %{$r_matrix->{$opt}->{$t_from}} )
> +	    {
> +		my $result= "";
> +		my $bg= "#ffffff";
> +		if ($r_matrix->{$opt}->{$t_from}->{$t_to})
> +		{
> +		    $result= $r_matrix->{$opt}->{$t_from}->{$t_to};
> +		    if ($result =~ m/ok/i)
> +		    {
> +			$bg= "#80ff80";
> +		    }
> +		    elsif ($result =~ m/^TER_.+_ENGINE_WRONG_TYPE/)
> +		    {
> +			$bg= "#c0c0c0";
> +		    }
> +		    elsif ($result =~ m/^(ER\_|TER\_).+/)
> +		    {
> +			$bg= "#ff5b5b";
> +		    }
> +		}
> +		$html_out .= "\t<td bgcolor=$bg>$result</td>\n";
> +	    }	
> +	    $html_out .= "</tr>\n";
> +	}
> +	$html_out .= "</tr>\n</table>\n";	
> +    }
> +    $html_out .= "</body>\n</html>\n";
> +    open MATRIX, ">$filename";
> +    print MATRIX $html_out;
> +    close MATRIX;
> +}
> +
> +sub exit_from_test
> +{
> +    my ($code, $text)= @_;
> +    print $text . "\n";
> +    return $code;
> +}
> +
> +sub shutdown
> +{
> +    return;
> +}
> +1;
> +__END__;
> +
> +=head1 NAME
> +
> +rep::data_types
> +
> +=head1 SYNOPSIS
> +
> +Matrix builder
> +
> +=back
>
> === added file 'suites/rep/data_types/config.pl'
> --- a/suites/rep/data_types/config.pl	1970-01-01 00:00:00 +0000
> +++ b/suites/rep/data_types/config.pl	2009-05-14 21:04:11 +0000
> @@ -0,0 +1,40 @@
> +package rep::data_types::config;
> +
> +BEGIN { }
> +
> +# Options for test
> +
> +# Verbose
> +our $verbose= 1;
> +
> +# Record matrix
> +our $record= 0;
> +
> +#
> +our $mode= "";
> +# Paths to files
> +
> +our $data_types_config_file= "./suites/rep/data_types/data_types.conf";
> +our $error_messages_file= $Parameters::build . "/sql/share/errmsg.txt";
> +our $matrix_file= "./suites/rep/data_types/data_types_matrix";
> +our $matrix_report_file= "./var/tmp/data_types";
> +
> +# Server options
> +our $server_options = [
> +    {	
> +	"name" => "engine",
> +	"affected" => "master,slave",
> +	"values" => ["MyISAM", "InnoDB", "MEMORY"],
> +#	"values" => ["InnoDB"],
> +    },
> +    {
> +	"name" => "binlog_format",
> +	"affected" => "master",
> +	"values" => ["MIXED", "STATEMENT", "ROW"],
> +#	"values" => ["MIXED"],
> +    },
> +];
> +
> +return 1;
> +
> +END { }
>
> === added file 'suites/rep/data_types/data_types.conf'
> --- a/suites/rep/data_types/data_types.conf	1970-01-01 00:00:00 +0000
> +++ b/suites/rep/data_types/data_types.conf	2009-05-14 21:04:11 +0000
> @@ -0,0 +1,151 @@
> +[BIT]
> +group: numeric
> +values: 0b0000000000000000000000000000000000000000000000000000000000000000,
> 0b1111111111111111111111111111111111111111111111111111111111111111
> +
> +[TINYINT SIGNED]
> +group: numeric
> +values: -128, 0, 127
> +
> +[TINYINT UNSIGNED]
> +group: numeric
> +values: 0, 255
> +
> +[SMALLINT SIGNED]
> +group: numeric
> +values: -32768, 0, 32767
> +
> +[SMALLINT UNSIGNED]
> +group: numeric
> +values: 0, 65535
> +
> +[MEDIUMINT SIGNED]
> +group: numeric
> +values: -8388608, 0, 8388607
> +
> +[MEDIUMINT UNSIGNED]
> +group: numeric
> +values: 0, 16777215
> +
> +[INT SIGNED]
> +group: numeric
> +values: -2147483648, 0, 2147483647
> +
> +[INT UNSIGNED]
> +group: numeric
> +values: 0, 4294967295
> +
> +[BIGINT SIGNED]
> +group: numeric
> +values: -9223372036854775808, 0, 9223372036854775807
> +
> +[BIGINT UNSIGNED]
> +group: numeric
> +values: 0, 18446744073709551615
> +
> +[FLOAT SIGNED]
> +group: numeric
> +values: -3.402823466E+38, -1.175494351E-38, 0, 1.175494351E-38, 3.402823466E+38
> +
> +[FLOAT UNSIGNED]
> +group: numeric
> +values: 0, 1.175494351E-38, 3.402823466E+38
> +
> +[DOUBLE SIGNED]
> +group: numeric
> +values: -1.7976931348623157e+308, -2.2250738585072014E-308, 0,
> 2.2250738585072014E-308, 1.7976931348623157e+308
> +
> +[DOUBLE UNSIGNED]
> +group: numeric
> +values: 0, 2.2250738585072014E-308, 1.7976931348623157e+308
> +
> +[DATETIME]
> +group: datetime
> +values: '1000-01-01 00:00:00', '9999-12-31 23:59:59'
> +
> +[DATE]
> +group: datetime
> +values: '1000-01-01', '9999-12-31'
> +
> +[TIME]
> +group: datetime
> +values: '-838:59:59', '838:59:59'
> +
> +[TIMESTAMP]
> +group: datetime
> +values: '1970-01-01 00:00:01', '2038-01-09 03:14:07'
> +
> +[YEAR(2)]
> +group: datetime
> +values: '00', '69', '70', '99'
> +
> +[YEAR(4)]
> +group: datetime
> +values: '1901', '2155'
> +
> +[CHAR(255)]
> +group: string
> +query_before: SET @test_data =
> CHAR(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255)
> +values: @test_data
>   
Do we really need this query_before?
> +
> +[VARCHAR(255)]
> +group: string
> +query_before: SET @test_data =
> CHAR(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255)
> +values: @test_data
> +
> +[BINARY(255)]
> +group: string
> +query_before: SET @test_data =
> CHAR(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255)
> +values: @test_data
> +
> +[VARBINARY(255)]
> +group: string
> +query_before: SET @test_data =
> CHAR(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255)
> +values: @test_data
> +
> +[TINYBLOB]
> +group: string
> +engines: innodb, myisam
>   
Do we really need to specify the storage engine at this point?
> +query_before: SET @test_data =
> CHAR(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255)
> +values: @test_data
> +
> +[BLOB]
> +group: string
> +engines: innodb, myisam
> +query_before: SET @test_data =
> CHAR(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255)
> +values: REPEAT(@test_data,200)
> +
> +[MEDIUMBLOB]
> +group: string
> +engines: innodb, myisam
> +query_before: SET @test_data =
> CHAR(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255)
> +values: REPEAT(@test_data,1000)
> +
> +#[LONGBLOB]
> +#group: string
> +#engines: innodb, myisam
> +#query_before: SET @test_data =
> CHAR(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255)
> +#values: REPEAT(@test_data,65000)
> +
> +[TINYTEXT]
> +group: string
> +engines: innodb, myisam
> +query_before: SET @test_data =
> CHAR(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255)
> +values: @test_data
> +
> +[TEXT]
> +group: string
> +engines: innodb, myisam
> +query_before: SET @test_data =
> CHAR(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255)
> +values: REPEAT(@test_data,200)
> +
> +[MEDIUMTEXT]
> +group: string
> +engines: innodb, myisam
> +query_before: SET @test_data =
> CHAR(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255)
> +values: REPEAT(@test_data,1000)
> +
> +#[LONGTEXT]
> +#group: string
> +#engines: innodb, myisam
> +#query_before: SET @test_data =
> CHAR(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255)
> +#values: REPEAT(@test_data,66000)
>
> === added file 'suites/rep/data_types/data_types_matrix'
> Binary files a/suites/rep/data_types/data_types_matrix	1970-01-01 00:00:00 +0000 and
> b/suites/rep/data_types/data_types_matrix	2009-05-14 21:04:11 +0000 differ
>
>
>   


Thread
bzr commit into nuts branch (Serge.Kozlov:318) WL#4840 WL#4845 WL#4846Serge Kozlov14 May
  • Re: bzr commit into nuts branch (Serge.Kozlov:318) WL#4840 WL#4845WL#4846Alfranio Correia18 May
  • Re: bzr commit into nuts branch (Serge.Kozlov:318) WL#4840 WL#4845WL#4846Luís Soares18 May