From ca5b1b54312cf9bc4a8252134874d82cf394eb48 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 30 Nov 2011 11:37:28 +0100 Subject: test both federated and federatedX in the federated suite. mysql-test/lib/My/Options.pm: My::Options::is_set() now matches both option names and values! mysql-test/lib/mtr_cases.pm: 1. don't merge --plugin-load here, it's too early 2. don't skip combinations that set --plugin-load just because the test needs another --plugin-load. Skip *only* if test's --plugin-load matches *exactly* --plugin-load of one of the combinations. 3. if skipping all combinations but one, still assign the test to the combination mysql-test/mysql-test-run.pl: 1. remove dead code - don't set variables that aren't used. 2. bugfix: allow one-letter combination names 3. in the command line, merge all --plugin-load options in one storage/federated/ha_federated.cc: bugfix: garbage character in the generated SELECT query --- mysql-test/mysql-test-run.pl | 88 +++++++------------------------------------- 1 file changed, 14 insertions(+), 74 deletions(-) (limited to 'mysql-test/mysql-test-run.pl') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 1c9d3b5159f..b2c7ee2fc37 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2096,79 +2096,6 @@ sub environment_setup { push(@ld_library_paths, "$basedir/storage/ndb/src/.libs"); } - # -------------------------------------------------------------------------- - # Add the path where mysqld will find udf_example.so - # -------------------------------------------------------------------------- - my $lib_udf_example= - mtr_file_exists(vs_config_dirs('sql', 'udf_example.dll'), - "$basedir/sql/.libs/udf_example.so",); - - if ( $lib_udf_example ) - { - push(@ld_library_paths, dirname($lib_udf_example)); - } - - $ENV{'UDF_EXAMPLE_LIB'}= - ($lib_udf_example ? basename($lib_udf_example) : ""); - $ENV{'UDF_EXAMPLE_LIB_OPT'}= "--plugin-dir=". - ($lib_udf_example ? dirname($lib_udf_example) : ""); - - # -------------------------------------------------------------------------- - # Add the path where mysqld will find ha_example.so - # -------------------------------------------------------------------------- - if ($mysql_version_id >= 50100) { - my $plugin_filename; - if (IS_WINDOWS) - { - $plugin_filename = "ha_example.dll"; - } - else - { - $plugin_filename = "ha_example.so"; - } - my $lib_example_plugin= - mtr_file_exists(vs_config_dirs('storage/example',$plugin_filename), - "$basedir/storage/example/.libs/".$plugin_filename, - "$basedir/lib/mysql/plugin/".$plugin_filename); - $ENV{'EXAMPLE_PLUGIN'}= - ($lib_example_plugin ? basename($lib_example_plugin) : ""); - $ENV{'EXAMPLE_PLUGIN_OPT'}= "--plugin-dir=". - ($lib_example_plugin ? dirname($lib_example_plugin) : ""); - - $ENV{'HA_EXAMPLE_SO'}="'".$plugin_filename."'"; - $ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=EXAMPLE=".$plugin_filename; - } - - # -------------------------------------------------------------------------- - # Add the path where mysqld will find ha_federated.so - # -------------------------------------------------------------------------- - my $fedplug_filename; - if (IS_WINDOWS) { - $fedplug_filename = "ha_federated.dll"; - } else { - $fedplug_filename = "ha_federated.so"; - } - my $lib_fed_plugin= - mtr_file_exists(vs_config_dirs('storage/federated',$fedplug_filename), - "$basedir/storage/federated/.libs/".$fedplug_filename, - "$basedir/lib/mysql/plugin/".$fedplug_filename); - - $ENV{'FEDERATED_PLUGIN'}= $fedplug_filename; - $ENV{'FEDERATED_PLUGIN_DIR'}= - ($lib_fed_plugin ? dirname($lib_fed_plugin) : ""); - - # ---------------------------------------------------- - # Add the path where mysqld will find mypluglib.so - # ---------------------------------------------------- - my $lib_simple_parser= - mtr_file_exists(vs_config_dirs('plugin/fulltext', 'mypluglib.dll'), - "$basedir/plugin/fulltext/.libs/mypluglib.so",); - - $ENV{'SIMPLE_PARSER'}= - ($lib_simple_parser ? basename($lib_simple_parser) : ""); - $ENV{'SIMPLE_PARSER_OPT'}= "--plugin-dir=". - ($lib_simple_parser ? dirname($lib_simple_parser) : ""); - # -------------------------------------------------------------------------- # Valgrind need to be run with debug libraries otherwise it's almost # impossible to add correct supressions, that means if "/usr/lib/debug" @@ -3917,7 +3844,7 @@ sub run_testcase ($$) { # Allow only alpanumerics pluss _ - + . in combination names, # or anything beginning with -- (the latter comes from --combination) my $combination= $tinfo->{combination}; - if ($combination && $combination !~ /^\w[-\w\.\+]+$/ + if ($combination && $combination !~ /^\w[-\w\.\+]*$/ && $combination !~ /^--/) { mtr_error("Combination '$combination' contains illegal characters"); @@ -5050,6 +4977,9 @@ sub mysqld_arguments ($$$) { } my $found_skip_core= 0; + my @plugins; + my %seen; + my $plugin; foreach my $arg ( @$extra_opts ) { # Allow --skip-core-file to be set in -[master|slave].opt file @@ -5066,6 +4996,11 @@ sub mysqld_arguments ($$$) { { ; # Dont add --skip-log-bin when mysqld have --log-slave-updates in config } + elsif ($plugin = mtr_match_prefix($arg, "--plugin-load=")) + { + push @plugins, $plugin unless $seen{$plugin}; + $seen{$plugin} = 1; + } else { mtr_add_arg($args, "%s", $arg); @@ -5082,6 +5017,11 @@ sub mysqld_arguments ($$$) { mtr_add_arg($args, "--loose-debug-sync-timeout=%s", $opt_debug_sync_timeout) unless $opt_user_args; + if (@plugins) { + my $sep = (IS_WINDOWS) ? ';' : ':'; + mtr_add_arg($args, "--plugin-load=%s" . join($sep, @plugins)); + } + return $args; } -- cgit v1.2.1