Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-12-06 16:02:21+01:00, msvensson@stripped +12 -0
Add --print-testcases
Remove old code
Fix bug, look at $server->option
Move ssl args to ConfigFactory
Add section for mysqlbinlog and client
mysql-test/lib/My/Config.pm@stripped, 2007-12-06 16:02:14+01:00, msvensson@stripped +1 -0
Make insert return the newly inserted group(or already existing if one already exist)
mysql-test/lib/My/ConfigFactory.pm@stripped, 2007-12-06 16:02:14+01:00, msvensson@stripped +82 -43
Add --print-testcases
Remove old code
Fix bug, look at $server->option
Move ssl args to ConfigFactory
Add section for mysqlbinlog and client
mysql-test/lib/mtr_cases.pl@stripped, 2007-12-06 16:02:14+01:00, msvensson@stripped +9 -18
Add --print-testcase
Remove unused code
mysql-test/mysql-test-run.pl@stripped, 2007-12-06 16:02:14+01:00, msvensson@stripped +3 -27
Add --print-testcases
Remove old code
Fix bug, look at $server->option
Move ssl args to ConfigFactory
mysql-test/r/rpl_loaddata.result@stripped, 2007-12-06 16:02:14+01:00, msvensson@stripped +1 -1
File grows when loading from longer path
mysql-test/r/rpl_loaddatalocal.result@stripped, 2007-12-06 16:02:14+01:00, msvensson@stripped +4 -4
Rename mysqld.1 -> mysqld.1/data
mysql-test/r/rpl_log.result@stripped, 2007-12-06 16:02:19+01:00, msvensson@stripped +6 -6
File grows when loading from longer path
mysql-test/r/rpl_misc_functions.result@stripped, 2007-12-06 16:02:19+01:00, msvensson@stripped +3 -3
Rename mysqld.1 -> mysqld.1/data
Rename ../tmp -> ../../tmp
mysql-test/t/rpl000015-slave.opt@stripped, 2007-12-06 16:02:19+01:00, msvensson@stripped +2 -0
Add slave.opt for rpl000015 instead of .slave-mi
mysql-test/t/rpl000015-slave.opt@stripped, 2007-12-06 16:02:19+01:00, msvensson@stripped +0 -0
mysql-test/t/rpl_dual_pos_advance.test@stripped, 2007-12-06 16:02:19+01:00, msvensson@stripped +2 -2
Rename to correct relay log file name
mysql-test/t/rpl_misc_functions.test@stripped, 2007-12-06 16:02:19+01:00, msvensson@stripped +2 -2
Rename ../tmp to ../../tmp
mysql-test/t/rpl_rotate_logs-slave.opt@stripped, 2007-12-06 15:30:10+01:00, msvensson@stripped +0 -0
Rename: mysql-test/t/rpl_rotate_logs.slave-mi -> mysql-test/t/rpl_rotate_logs-slave.opt
diff -Nrup a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm
--- a/mysql-test/lib/My/Config.pm 2007-12-04 12:19:00 +01:00
+++ b/mysql-test/lib/My/Config.pm 2007-12-06 16:02:14 +01:00
@@ -259,6 +259,7 @@ sub insert {
# Add the option to the group
$group->insert($option, $value, $if_not_exist);
}
+ return $group;
}
#
diff -Nrup a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm
--- a/mysql-test/lib/My/ConfigFactory.pm 2007-12-04 12:19:00 +01:00
+++ b/mysql-test/lib/My/ConfigFactory.pm 2007-12-06 16:02:14 +01:00
@@ -21,18 +21,25 @@ my @pre_rules=
my @share_locations= ("share/mysql", "sql/share", "share");
-sub fix_charset_dir {
- my ($self, $config, $group_name, $group)= @_;
+
+sub get_basedir {
+ my ($self, $group)= @_;
my $basedir= $group->if_exist('basedir') ||
$self->{ARGS}->{basedir};
- return my_find_dir($basedir, \@share_locations, "charsets");
+ return $basedir;
+}
+
+
+sub fix_charset_dir {
+ my ($self, $config, $group_name, $group)= @_;
+ return my_find_dir($self->get_basedir($group),
+ \@share_locations, "charsets");
}
sub fix_language {
my ($self, $config, $group_name, $group)= @_;
- my $basedir= $group->if_exist('basedir') ||
- $self->{ARGS}->{basedir};
- return my_find_dir($basedir, \@share_locations, "english");
+ return my_find_dir($self->get_basedir($group),
+ \@share_locations, "english");
}
sub fix_datadir {
@@ -94,8 +101,8 @@ sub fix_secure_file_priv {
}
sub fix_std_data {
- my ($self)= @_;
- my $basedir= $self->{ARGS}->{basedir};
+ my ($self, $config, $group_name, $group)= @_;
+ my $basedir= $self->get_basedir($group);
return "$basedir/mysql-test/std_data";
}
@@ -109,11 +116,21 @@ sub fix_ssl_server_cert {
return "$std_data/server-cert.pem"
}
+sub fix_ssl_client_cert {
+ my $std_data= fix_std_data(@_);
+ return "$std_data/client-cert.pem"
+}
+
sub fix_ssl_server_key {
my $std_data= fix_std_data(@_);
return "$std_data/server-key.pem"
}
+sub fix_ssl_client_key {
+ my $std_data= fix_std_data(@_);
+ return "$std_data/client-key.pem"
+}
+
#
# Rules to run for each mysqld in the config
@@ -193,6 +210,28 @@ my @cluster_config_rules=
#
+# Rules to run for [client] section
+# - will be run in order listed here
+#
+my @client_rules=
+(
+ { 'loose-ssl-ca' => \&fix_ssl_ca },
+ { 'loose-ssl-cert' => \&fix_ssl_client_cert },
+ { 'loose-ssl-key' => \&fix_ssl_client_key },
+);
+
+
+#
+# Rules to run for [mysqlbinlog] section
+# - will be run in order listed here
+#
+my @mysqlbinlog_rules=
+(
+ { 'character-sets-dir' => \&fix_charset_dir },
+);
+
+
+#
# Generate a [client.<suffix>] group pointing to be
# used for connecting to [mysqld.<suffix>]
#
@@ -245,22 +284,6 @@ sub post_check_client_groups {
}
-# MASV
-# Add setting to [client] that all clients will use
-#
-#sub post_fix_client {
-# my ($self, $config)= @_;
-#
-# my %client=
-# (
-# 'loose-ssl-ca' => \&fix_ssl_ca,
-# 'loose-ssl-cert' => \&fix_ssl_client_cert,
-# 'loose-ssl-key' => \&fix_ssl_client_key,
-# );
-#
-#}
-
-
sub resolve_at_variable {
my ($self, $config, $group, $option)= @_;
@@ -335,37 +358,43 @@ sub post_fix_mysql_cluster_section {
my @post_rules=
(
\&post_check_client_groups,
-# \&post_fix_client,
\&post_fix_mysql_cluster_section,
\&post_fix_resolve_at_variables,
);
+sub run_rules_for_group {
+ my ($self, $config, $group, @rules)= @_;
+ foreach my $hash ( @rules ) {
+ while (my ($option, $rule)= each( %{$hash} )) {
+ # Only run this rule if the value is not already defined
+ if (!$config->exists($group->name(), $option)) {
+ my $value;
+ if (ref $rule eq "CODE") {
+ # Call the rule function
+ $value= &$rule($self, $config, $group->name(),
+ $config->group($group->name()));
+ } else {
+ $value= $rule;
+ }
+ if (defined $value) {
+ $config->insert($group->name(), $option, $value, 1);
+ }
+ }
+ }
+ }
+}
+
+
sub run_section_rules {
my ($self, $config, $name, @rules)= @_;
foreach my $group ( $config->like($name) ) {
- foreach my $hash ( @rules ) {
- while (my ($option, $rule)= each( %{$hash} )) {
- # Only run this rule if the value is not already defined
- if (!$config->exists($group->name(), $option)) {
- my $value;
- if (ref $rule eq "CODE") {
- # Call the rule function
- $value= &$rule($self, $config, $group->name(),
- $config->group($group->name()));
- } else {
- $value= $rule;
- }
- if (defined $value) {
- $config->insert($group->name(), $option, $value, 1);
- }
- }
- }
- }
+ $self->run_rules_for_group($config, $group, @rules);
}
}
+
sub run_generate_sections_from_cluster_config {
my ($self, $config)= @_;
@@ -465,6 +494,16 @@ sub new_config {
$self->run_section_rules($config,
'mysqld.',
@mysqld_rules);
+
+ # [mysqlbinlog] need additional settings
+ $self->run_rules_for_group($config,
+ $config->insert('mysqlbinlog'),
+ @mysqlbinlog_rules);
+
+ # Additional reuls required for [client]
+ $self->run_rules_for_group($config,
+ $config->insert('client'),
+ @client_rules);
{
# Run post rules
diff -Nrup a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
--- a/mysql-test/lib/mtr_cases.pl 2007-12-05 15:31:54 +01:00
+++ b/mysql-test/lib/mtr_cases.pl 2007-12-06 16:02:14 +01:00
@@ -48,7 +48,7 @@ sub init_pattern {
##############################################################################
#
-# Collect information about test cases we are to run
+# Collect information about test cases to be run
#
##############################################################################
@@ -60,7 +60,7 @@ sub collect_test_cases ($) {
@_
);
- my $cases = []; # Array of hash(one hash for each testcase)
+ my $cases= []; # Array of hash(one hash for each testcase)
$do_test= init_pattern($opts{'do-test'}, "--do-test");
$skip_test= init_pattern($opts{'skip-test'}, "--skip-test");
@@ -165,6 +165,12 @@ sub collect_test_cases ($) {
}
+ my $print_testcases= $opts{'print-testcases'};
+ if (defined $print_testcases){
+ print_testcases(@$cases);
+ exit(1);
+ }
+
return $cases;
}
@@ -513,13 +519,6 @@ sub process_opts_file {
next;
}
- $value= mtr_match_prefix($opt, "--slave-num=");
- if ( defined $value )
- {
- $tinfo->{'slave_num'}= $value;
- next;
- }
-
$value= mtr_match_prefix($opt, "--result-file=");
if ( defined $value )
{
@@ -533,7 +532,7 @@ sub process_opts_file {
if ( defined $value)
{
# Specifies the configuration file to use for this test
- $tinfo->{'config_file_template'}= "configs/$value";
+ $tinfo->{'template_path'}= "configs/$value";
next;
}
@@ -811,14 +810,6 @@ sub collect_one_test_case {
$tinfo->{'comment'}= "No replication tests(--skip-rpl)";
return $tinfo;
}
- # Default for rpl tests, use one slave if not set already
- $tinfo->{'slave_num'}= $tinfo->{'slave_num'} || 1;
- }
-
- if ( $tinfo->{'federated_test'} )
- {
- # Default, federated uses the first slave as it's federated database
- $tinfo->{'slave_num'}= 1;
}
# ----------------------------------------------------------------------
diff -Nrup a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
--- a/mysql-test/mysql-test-run.pl 2007-12-05 17:10:15 +01:00
+++ b/mysql-test/mysql-test-run.pl 2007-12-06 16:02:14 +01:00
@@ -377,6 +377,7 @@ sub command_line_setup {
'sleep=i' => \$opt_sleep,
'start-dirty' => \$opt_start_dirty,
'start' => \$opt_start,
+ 'print-testcases' => \&collect_option,
# MASV 'repeat'
# MASV 'retry'
'timer!' => \$opt_timer,
@@ -391,16 +392,6 @@ sub command_line_setup {
usage("") if $opt_usage;
- # We require that we are in the "mysql-test" directory
- # to run mysql-test-run
- my $scriptname= basename($0);
- if (! -f $scriptname)
- {
- mtr_error("Can't find the location for the mysql-test-run script\n" .
- "Go to to the mysql-test directory and execute the script " .
- "as follows:\n./$scriptname");
- }
-
if ( -d "../sql" )
{
$source_dist= 1;
@@ -1901,9 +1892,6 @@ sub check_ports_free
return 1; # One port was not free
}
}
-# MASV TODO
-# return parallel(&check_port_free,
-# @ports_to_check);
return 0; # All ports free
}
@@ -2625,8 +2613,6 @@ sub mysqld_arguments ($$$) {
mtr_add_arg($args, "%s%s", $prefix, "--core-file");
}
-# MASV move core-file before extra_opts, core-file=0/skip-core-file?
-
if ( $is_win32 ){
mtr_add_arg($args, "%s--log-error=%s", $prefix, $mysqld->{"path_myerr"});
}
@@ -2759,7 +2745,7 @@ sub server_need_restart {
return 0;
}
- if ( $server->{'#!force-restart'} ) {
+ if ( $server->option('#!force-restart') ) {
mtr_verbose("Restart: forced in configuration");
return 1;
}
@@ -2900,7 +2886,7 @@ sub stop_servers($$) {
foreach my $server (@servers)
{
# Remove datadir
- if ( $server->{'#!remove-datadir'} )
+ if ( $server->option('#!remove-datadir') )
{
rmtree($server->value('datadir'));
}
@@ -3168,16 +3154,6 @@ sub start_mysqltest ($) {
}
client_debug_arg($args, "mysqltest");
-
- if ( $opt_ssl_supported )
- {
- mtr_add_arg($args, "--ssl-ca=%s/std_data/cacert.pem",
- $glob_mysql_test_dir);
- mtr_add_arg($args, "--ssl-cert=%s/std_data/client-cert.pem",
- $glob_mysql_test_dir);
- mtr_add_arg($args, "--ssl-key=%s/std_data/client-key.pem",
- $glob_mysql_test_dir);
- }
if ( $opt_ssl )
{
diff -Nrup a/mysql-test/r/rpl_loaddata.result b/mysql-test/r/rpl_loaddata.result
--- a/mysql-test/r/rpl_loaddata.result 2007-12-04 12:18:55 +01:00
+++ b/mysql-test/r/rpl_loaddata.result 2007-12-06 16:02:14 +01:00
@@ -22,7 +22,7 @@ day id category name
2003-03-22 2416 a bbbbb
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-slave-bin.000001 1272
+slave-bin.000001 1278
drop table t1;
drop table t2;
drop table t3;
diff -Nrup a/mysql-test/r/rpl_loaddatalocal.result b/mysql-test/r/rpl_loaddatalocal.result
--- a/mysql-test/r/rpl_loaddatalocal.result 2007-12-04 12:18:55 +01:00
+++ b/mysql-test/r/rpl_loaddatalocal.result 2007-12-06 16:02:14 +01:00
@@ -5,19 +5,19 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1(a int);
-select * into outfile 'MYSQLTEST_VARDIR/mysqld.1/rpl_loaddatalocal.select_outfile' from t1;
+select * into outfile 'MYSQLTEST_VARDIR/mysqld.1/data/rpl_loaddatalocal.select_outfile' from t1;
truncate table t1;
-load data local infile 'MYSQLTEST_VARDIR/mysqld.1/rpl_loaddatalocal.select_outfile' into table t1;
+load data local infile 'MYSQLTEST_VARDIR/mysqld.1/data/rpl_loaddatalocal.select_outfile' into table t1;
select a,count(*) from t1 group by a;
a count(*)
1 10000
drop table t1;
create table t1(a int);
insert into t1 values (1), (2), (2), (3);
-select * into outfile 'MYSQLTEST_VARDIR/mysqld.1/rpl_loaddatalocal.select_outfile' from t1;
+select * into outfile 'MYSQLTEST_VARDIR/mysqld.1/data/rpl_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key);
-load data local infile 'MYSQLTEST_VARDIR/mysqld.1/rpl_loaddatalocal.select_outfile' into table t1;
+load data local infile 'MYSQLTEST_VARDIR/mysqld.1/data/rpl_loaddatalocal.select_outfile' into table t1;
select * from t1;
a
1
diff -Nrup a/mysql-test/r/rpl_log.result b/mysql-test/r/rpl_log.result
--- a/mysql-test/r/rpl_log.result 2007-12-04 12:18:55 +01:00
+++ b/mysql-test/r/rpl_log.result 2007-12-06 16:02:19 +01:00
@@ -74,7 +74,7 @@ master-bin.000002 510
start slave;
show binary logs;
Log_name File_size
-slave-bin.000001 1552
+slave-bin.000001 1555
slave-bin.000002 348
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
@@ -85,11 +85,11 @@ slave-bin.000001 247 Query 1 338 use `te
slave-bin.000001 338 Query 1 414 use `test`; drop table t1
slave-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
slave-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
-slave-bin.000001 1121 Execute_load_query 1 1271 use `test`; load data INFILE '../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
-slave-bin.000001 1271 Query 1 1347 use `test`; drop table t1
-slave-bin.000001 1347 Query 1 1433 use `test`; create table t5 (a int)
-slave-bin.000001 1433 Query 1 1509 use `test`; drop table t5
-slave-bin.000001 1509 Rotate 2 1552 slave-bin.000002;pos=4
+slave-bin.000001 1121 Execute_load_query 1 1274 use `test`; load data INFILE '../../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
+slave-bin.000001 1274 Query 1 1350 use `test`; drop table t1
+slave-bin.000001 1350 Query 1 1436 use `test`; create table t5 (a int)
+slave-bin.000001 1436 Query 1 1512 use `test`; drop table t5
+slave-bin.000001 1512 Rotate 2 1555 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
diff -Nrup a/mysql-test/r/rpl_misc_functions.result b/mysql-test/r/rpl_misc_functions.result
--- a/mysql-test/r/rpl_misc_functions.result 2007-12-04 12:18:55 +01:00
+++ b/mysql-test/r/rpl_misc_functions.result 2007-12-06 16:02:19 +01:00
@@ -15,7 +15,7 @@ insert into t1 values(3, 0, 0, 0, passwo
insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
select * into outfile 'rpl_misc_functions.outfile' from t1;
create table t2 like t1;
-load data local infile 'MYSQLTEST_VARDIR/mysqld.1/test/rpl_misc_functions.outfile' into table t2;
+load data local infile 'MYSQLTEST_VARDIR/mysqld.1/data/test/rpl_misc_functions.outfile' into table t2;
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
id i r1 r2 p id i r1 r2 p
drop table t1;
@@ -41,9 +41,9 @@ CALL test_replication_sp2();
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
-select * from t1 into outfile "../tmp/t1_slave.txt";
+select * from t1 into outfile "../../tmp/t1_slave.txt";
create temporary table t1_slave select * from t1 where 1=0;
-load data infile '../tmp/t1_slave.txt' into table t1_slave;
+load data infile '../../tmp/t1_slave.txt' into table t1_slave;
select count(*) into @aux from t1 join t1_slave using (id)
where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ;
SELECT @aux;
diff -Nrup a/mysql-test/t/rpl000015-slave.opt b/mysql-test/t/rpl000015-slave.opt
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/rpl000015-slave.opt 2007-12-06 16:02:19 +01:00
@@ -0,0 +1,2 @@
+--server-id=22 --master-connect-retry=7
+
diff -Nrup a/mysql-test/t/rpl_dual_pos_advance.test b/mysql-test/t/rpl_dual_pos_advance.test
--- a/mysql-test/t/rpl_dual_pos_advance.test 2007-03-20 11:15:14 +01:00
+++ b/mysql-test/t/rpl_dual_pos_advance.test 2007-12-06 16:02:19 +01:00
@@ -110,5 +110,5 @@ sync_with_master;
# Cleanup
# The A->B->A replication causes the master to start writing relay logs
# in var/run, remove them
-remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.000001;
-remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.index;
+remove_file $MYSQLTEST_VARDIR/run/mysqld-relay-bin.000001;
+remove_file $MYSQLTEST_VARDIR/run/mysqld-relay-bin.index;
diff -Nrup a/mysql-test/t/rpl_misc_functions.test b/mysql-test/t/rpl_misc_functions.test
--- a/mysql-test/t/rpl_misc_functions.test 2007-12-04 12:18:56 +01:00
+++ b/mysql-test/t/rpl_misc_functions.test 2007-12-06 16:02:19 +01:00
@@ -81,12 +81,12 @@ INSERT INTO t1 (col_a) VALUES (test_repl
--sync_slave_with_master
# Dump table on slave
-select * from t1 into outfile "../tmp/t1_slave.txt";
+select * from t1 into outfile "../../tmp/t1_slave.txt";
# Load data from slave into temp table on master
connection master;
create temporary table t1_slave select * from t1 where 1=0;
-load data infile '../tmp/t1_slave.txt' into table t1_slave;
+load data infile '../../tmp/t1_slave.txt' into table t1_slave;
--remove_file $MYSQLTEST_VARDIR/tmp/t1_slave.txt
# Compare master and slave temp table, use subtraction
diff -Nrup a/mysql-test/t/rpl_rotate_logs-slave.opt b/mysql-test/t/rpl_rotate_logs-slave.opt
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/rpl_rotate_logs-slave.opt 2007-12-06 15:30:10 +01:00
@@ -0,0 +1 @@
+--server-id=2
diff -Nrup a/mysql-test/t/rpl_rotate_logs.slave-mi b/mysql-test/t/rpl_rotate_logs.slave-mi
--- a/mysql-test/t/rpl_rotate_logs.slave-mi 2003-02-25 23:14:17 +01:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1 +0,0 @@
---server-id=2
| Thread |
|---|
| • bk commit into 5.0 tree (msvensson:1.2609) | msvensson | 6 Dec |