From c6ad5c819ede1c0f3daf16b08281d92f93c312fc Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 11 Jan 2011 10:51:31 +0100 Subject: [PATCH 1/9] Bug #59002 Please make mtr print correct file and line number when tests fail This patchs adds printing of a file stack (with line numbers) It does not fix the problem of a failure in the non-first iteration of a loop --- client/mysqltest.cc | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index a12c56c9657..38f8516f7da 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -1238,6 +1238,17 @@ static void cleanup_and_exit(int exit_code) exit(exit_code); } +void print_file_stack() +{ + for (struct st_test_file* err_file= cur_file; + err_file != file_stack; + err_file--) + { + fprintf(stderr, "included from %s at line %d:\n", + err_file->file_name, err_file->lineno); + } +} + void die(const char *fmt, ...) { static int dying= 0; @@ -1257,8 +1268,12 @@ void die(const char *fmt, ...) /* Print the error message */ fprintf(stderr, "mysqltest: "); if (cur_file && cur_file != file_stack) - fprintf(stderr, "In included file \"%s\": ", + { + fprintf(stderr, "In included file \"%s\": \n", cur_file->file_name); + print_file_stack(); + } + if (start_lineno > 0) fprintf(stderr, "At line %u: ", start_lineno); if (fmt) @@ -1288,20 +1303,14 @@ void die(const char *fmt, ...) void abort_not_supported_test(const char *fmt, ...) { va_list args; - struct st_test_file* err_file= cur_file; DBUG_ENTER("abort_not_supported_test"); /* Print include filestack */ fprintf(stderr, "The test '%s' is not supported by this installation\n", file_stack->file_name); fprintf(stderr, "Detected in file %s at line %d\n", - err_file->file_name, err_file->lineno); - while (err_file != file_stack) - { - err_file--; - fprintf(stderr, "included from %s at line %d\n", - err_file->file_name, err_file->lineno); - } + cur_file->file_name, cur_file->lineno); + print_file_stack(); /* Print error message */ va_start(args, fmt); From a18cde4734b8f94aa69741d614e8b4990c1befee Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 11 Jan 2011 10:53:22 +0100 Subject: [PATCH 2/9] Bug #58896 MTR should recognise combinations as experimental without needing wildcards Added a pattern match to cover combinations Added to readme file --- mysql-test/collections/README.experimental | 6 +++++- mysql-test/collections/default.experimental | 2 +- mysql-test/lib/mtr_report.pm | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mysql-test/collections/README.experimental b/mysql-test/collections/README.experimental index 2f5ee7b00ab..924e062b76a 100644 --- a/mysql-test/collections/README.experimental +++ b/mysql-test/collections/README.experimental @@ -15,9 +15,13 @@ The syntax is as follows: and any subsequent characters are ignored. 4) The full test case name including the suite and execution mode - must be specified, for example: + may be specified, for example: main.alias 'row' # bug#00000 +4b) Now, combinations will also be covered if only the test name is + specified, for example: + rpl.rpl_ps # Covers 'row', 'mix' and 'stmt' + 5) As an exception to item 4, the last character of the test case specification may be an asterisk (*). In that case, all test cases that start with the same characters up to the last letter before the asterisk diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index aa2f2e9f724..1e6ff625d39 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -21,7 +21,7 @@ main.outfile_loaddata @solaris # joro : Bug #46895 ndb.* # joro : NDB tests marked as experimental as agreed with bochklin -rpl.rpl_innodb_bug28430* @solaris # Bug#46029 +rpl.rpl_innodb_bug28430 @solaris # Bug#46029 rpl.rpl_row_sp011 @solaris # Joro : Bug #54138 rpl_ndb.* # joro : NDB tests marked as experimental as agreed with bochklin diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index 77f6920771d..42d93022392 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -129,7 +129,8 @@ sub mtr_report_test ($) { # Find out if this test case is an experimental one, so we can treat # the failure as an expected failure instead of a regression. for my $exp ( @$::experimental_test_cases ) { - if ( $exp ne $test_name ) { + # Include pattern match for combinations + if ( $exp ne $test_name && $test_name !~ /^$exp / ) { # if the expression is not the name of this test case, but has # an asterisk at the end, determine if the characters up to # but excluding the asterisk are the same From 063041853936b85446200e26a3da97a225e57aa0 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 11 Jan 2011 10:54:42 +0100 Subject: [PATCH 3/9] Bug #58900 query_get_value crashes when result begins with dollar sign Generalized fix for recursive backtick Optional arg to eval_expr telling it not to interpret --- client/mysqltest.cc | 13 +++++++++---- mysql-test/r/mysqltest.result | 3 +++ mysql-test/t/mysqltest.test | 6 ++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 38f8516f7da..feed964c2fa 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -474,7 +474,7 @@ VAR* var_init(VAR* v, const char *name, int name_len, const char *val, void var_free(void* v); VAR* var_get(const char *var_name, const char** var_name_end, my_bool raw, my_bool ignore_not_existing); -void eval_expr(VAR* v, const char *p, const char** p_end, bool backtick= true); +void eval_expr(VAR* v, const char *p, const char** p_end, bool do_eval= true); my_bool match_delimiter(int c, const char *delim, uint length); void dump_result_to_reject_file(char *buf, int size); void dump_warning_messages(); @@ -2371,7 +2371,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var) break; } } - eval_expr(var, value, 0); + eval_expr(var, value, 0, false); } dynstr_free(&ds_query); mysql_free_result(res); @@ -2401,12 +2401,16 @@ void var_copy(VAR *dest, VAR *src) } -void eval_expr(VAR *v, const char *p, const char **p_end, bool backtick) +void eval_expr(VAR *v, const char *p, const char **p_end, bool do_eval) { DBUG_ENTER("eval_expr"); DBUG_PRINT("enter", ("p: '%s'", p)); + /* Skip to treat as pure string if no evaluation */ + if (! do_eval) + goto NO_EVAL; + if (*p == '$') { VAR *vp; @@ -2426,7 +2430,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end, bool backtick) DBUG_VOID_RETURN; } - if (*p == '`' && backtick) + if (*p == '`') { var_query_set(v, p, p_end); DBUG_VOID_RETURN; @@ -2449,6 +2453,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end, bool backtick) } } + NO_EVAL: { int new_val_len = (p_end && *p_end) ? (int) (*p_end - p) : (int) strlen(p); diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 15730fff72c..00e4a598539 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -311,6 +311,9 @@ failing query in let create table t1 (a varchar(100)); insert into t1 values ('`select 42`'); `select 42` +insert into t1 values ('$dollar'); +$dollar +`select 42` drop table t1; mysqltest: At line 1: Error running query 'failing query': 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing query' at line 1 mysqltest: At line 1: Missing required argument 'filename' to command 'source' diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 56c86f7d431..52dfd8e86d3 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -859,6 +859,12 @@ insert into t1 values ('`select 42`'); let $a= `select * from t1`; # This should output `select 42`, not evaluate it again to 42 echo $a; +insert into t1 values ('$dollar'); +# These should also output the string without evaluating it. +let $a= query_get_value(select * from t1 order by a, a, 1); +echo $a; +let $a= query_get_value(select * from t1 order by a, a, 2); +echo $a; drop table t1; --error 1 From 5a66a6b86e22bb4a6bb16a5ab4c9c25193a0b420 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 11 Jan 2011 14:27:03 +0100 Subject: [PATCH 4/9] Bug #58841 Generalise handling of plugins in MTR mysql-test-run.pl script Put descriptions of plugins into a separate file read by MTR MTR itself has generalised code to read this and set env. variables Removed the *SO variables, updated some tests accordingly New commit: added optional list of plugin names for _LOAD variable Also made changes for the new AUTH_* plugins --- mysql-test/include/plugin.defs | 41 +++++ mysql-test/mysql-test-run.pl | 201 +++++++---------------- mysql-test/suite/bugs/t/bug57108.test | 2 +- mysql-test/t/bug46261.test | 2 +- mysql-test/t/fulltext_plugin.test | 2 +- mysql-test/t/plugin.test | 10 +- mysql-test/t/plugin_auth_qa_2-master.opt | 4 +- mysql-test/t/plugin_auth_qa_3-master.opt | 4 +- mysql-test/t/plugin_not_embedded.test | 4 +- 9 files changed, 113 insertions(+), 157 deletions(-) create mode 100644 mysql-test/include/plugin.defs diff --git a/mysql-test/include/plugin.defs b/mysql-test/include/plugin.defs new file mode 100644 index 00000000000..4da03dc2cc9 --- /dev/null +++ b/mysql-test/include/plugin.defs @@ -0,0 +1,41 @@ +# Definition file for plugins. +# +# [,...] +# +# The following variables will be set for a plugin, where PLUGVAR +# represents the variable name given as the 3rd item +# +# PLUGVAR: name of plugin file including extension .so or .dll +# PLUGVAR_DIR: name of directory where plugin was found +# PLUGVAR_OPT: mysqld option --plugin_dir=.... +# PLUGVAR_LOAD: option --plugin_load=.... if the 4th element is present +# +# If a listed plugin is not found, the corresponding variables will be +# set to empty, they will not be unset. +# +# The PLUGVAR variable is not quoted, so you must remember to quote it +# when using it in an INSTALL PLUGIN command. +# +# The envorinment variables can be used in tests. If adding a new plugin, +# you are free to pick your variable name, but please keep it upper +# case for consistency. +# +# The _LOAD variable will have a form +# +# --plugin_load==;=..... +# +# with name1, name2 etc from the comma separated list of plugin names +# in the optional 4th argument. + +auth_test_plugin plugin/auth PLUGIN_AUTH test_plugin_server +qa_auth_interface plugin/auth PLUGIN_AUTH_INTERFACE qa_auth_interface +qa_auth_server plugin/auth PLUGIN_AUTH_SERVER qa_auth_server +qa_auth_client plugin/auth PLUGIN_AUTH_CLIENT qa_auth_client +udf_example sql UDF_EXAMPLE_LIB +ha_example storage/example EXAMPLE_PLUGIN EXAMPLE +semisync_master plugin/semisync SEMISYNC_MASTER_PLUGIN +semisync_slave plugin/semisync SEMISYNC_SLAVE_PLUGIN +ha_archive storage/archive ARCHIVE_PLUGIN +ha_blackhole storage/blackhole BLACKHOLE_PLUGIN +ha_federated storage/federated FEDERATED_PLUGIN +mypluglib plugin/fulltext SIMPLE_PARSER diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index a7683b8d807..e2bb5d24205 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -131,10 +131,6 @@ my $opt_start_dirty; my $opt_start_exit; my $start_only; -my $auth_interface_fn; # the name of qa_auth_interface plugin -my $auth_server_fn; # the name of qa_auth_server plugin -my $auth_client_fn; # the name of qa_auth_client plugin -my $auth_filename; # the name of the authentication test plugin my $auth_plugin; # the path to the authentication test plugin END { @@ -1124,27 +1120,7 @@ sub command_line_setup { "$basedir/sql/share/charsets", "$basedir/share/charsets"); - # Look for auth test plugins - if (IS_WINDOWS) - { - $auth_filename = "auth_test_plugin.dll"; - $auth_interface_fn = "qa_auth_interface.dll"; - $auth_server_fn = "qa_auth_server.dll"; - $auth_client_fn = "qa_auth_client.dll"; - } - else - { - $auth_filename = "auth_test_plugin.so"; - $auth_interface_fn = "qa_auth_interface.so"; - $auth_server_fn = "qa_auth_server.so"; - $auth_client_fn = "qa_auth_client.so"; - } - $auth_plugin= - mtr_file_exists(vs_config_dirs('plugin/auth/',$auth_filename), - "$basedir/plugin/auth/.libs/" . $auth_filename, - "$basedir/lib/mysql/plugin/" . $auth_filename, - "$basedir/lib/plugin/" . $auth_filename); - + ($auth_plugin)= find_plugin("auth_test_plugin", "plugin/auth"); if (using_extern()) { @@ -1983,6 +1959,53 @@ sub find_plugin($$) return $lib_example_plugin; } +# +# Read plugin defintions file +# + +sub read_plugin_defs($) +{ + my ($defs_file)= @_; + + open(PLUGDEF, '<', $defs_file) + or mtr_error("Can't read plugin defintions file $defs_file"); + + while () { + next if /^#/; + my ($plug_file, $plug_loc, $plug_var, $plug_names)= split; + # Allow empty lines + next unless $plug_file; + mtr_error("Lines in $defs_file must have 3 or 4 items") unless $plug_var; + + my ($plugin)= find_plugin($plug_file, $plug_loc); + + # Set env. variables that tests may use, set to empty if plugin + # listed in def. file but not found. + + if ($plugin) { + $ENV{$plug_var}= basename($plugin); + $ENV{$plug_var.'_DIR'}= dirname($plugin); + $ENV{$plug_var.'_OPT'}= "--plugin-dir=".dirname($plugin); + if ($plug_names) { + my $lib_name= basename($plugin); + my $load_var= "--plugin_load="; + my $semi= ''; + foreach my $plug_name (split (',', $plug_names)) { + $load_var .= $semi . "$plug_name=$lib_name"; + $semi= ';'; + } + $ENV{$plug_var.'_LOAD'}= $load_var; + } + } else { + $ENV{$plug_var}= ""; + $ENV{$plug_var.'_DIR'}= ""; + $ENV{$plug_var.'_OPT'}= ""; + $ENV{$plug_var.'_LOAD'}= "" if $plug_names; + } + } + close PLUGDEF; +} + sub environment_setup { umask(022); @@ -2019,127 +2042,19 @@ sub environment_setup { } # -------------------------------------------------------------------------- - # Add the path where mysqld will find udf_example.so + # Read definitions from include/plugin.defs + # + # Plugin settings should no longer be added here, instead + # place definitions in include/plugin.defs. + # See comment in that file for details. # -------------------------------------------------------------------------- - my $udf_example_filename; - if (IS_WINDOWS) + read_plugin_defs("include/plugin.defs"); + + # Simplify reference to semisync plugins + if ($ENV{'SEMISYNC_MASTER_PLUGIN'}) { - $udf_example_filename = "udf_example.dll"; + $ENV{'SEMISYNC_PLUGIN_OPT'}= $ENV{'SEMISYNC_MASTER_PLUGIN_OPT'}; } - else - { - $udf_example_filename = "udf_example.so"; - } - my $lib_udf_example= - mtr_file_exists(vs_config_dirs('sql', $udf_example_filename), - "$basedir/sql/.libs/$udf_example_filename",); - - 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 the auth test plugin (dialog.so/dll) - # -------------------------------------------------------------------------- - if ($auth_plugin) - { - $ENV{'PLUGIN_AUTH'}= basename($auth_plugin); - $ENV{'PLUGIN_AUTH_OPT'}= "--plugin-dir=".dirname($auth_plugin); - - $ENV{'PLUGIN_AUTH_LOAD'}="--plugin_load=test_plugin_server=".$auth_filename; - $ENV{'PLUGIN_AUTH_INTERFACE'}="--plugin_load=qa_auth_interface=".$auth_interface_fn; - $ENV{'PLUGIN_AUTH_SERVER'}="--plugin_load=qa_auth_server=".$auth_server_fn; - $ENV{'PLUGIN_AUTH_CLIENT'}="--plugin_load=qa_auth_client=".$auth_client_fn; - } - else - { - $ENV{'PLUGIN_AUTH'}= ""; - $ENV{'PLUGIN_AUTH_OPT'}="--plugin-dir="; - $ENV{'PLUGIN_AUTH_LOAD'}=""; - $ENV{'PLUGIN_AUTH_INTERFACE'}=""; - $ENV{'PLUGIN_AUTH_SERVER'}=""; - $ENV{'PLUGIN_AUTH_CLIENT'}=""; - } - - - # -------------------------------------------------------------------------- - # Add the path where mysqld will find ha_example.so - # -------------------------------------------------------------------------- - if ($mysql_version_id >= 50100) { - my ($lib_example_plugin) = find_plugin("ha_example", "storage/example"); - - if($lib_example_plugin) - { - $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'}="'".basename($lib_example_plugin)."'"; - $ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=EXAMPLE=".basename($lib_example_plugin); - } - else - { - # Some ".opt" files use some of these variables, so they must be defined - $ENV{'EXAMPLE_PLUGIN'}= ""; - $ENV{'EXAMPLE_PLUGIN_OPT'}= ""; - $ENV{'HA_EXAMPLE_SO'}= ""; - $ENV{'EXAMPLE_PLUGIN_LOAD'}= ""; - } - } - - - # -------------------------------------------------------------------------- - # Add the path where mysqld will find semisync plugins - # -------------------------------------------------------------------------- - if (!$opt_embedded_server) { - - - my ($lib_semisync_master_plugin) = find_plugin("semisync_master", "plugin/semisync"); - my ($lib_semisync_slave_plugin) = find_plugin("semisync_slave", "plugin/semisync"); - - - if ($lib_semisync_master_plugin && $lib_semisync_slave_plugin) - { - $ENV{'SEMISYNC_MASTER_PLUGIN'}= basename($lib_semisync_master_plugin); - $ENV{'SEMISYNC_SLAVE_PLUGIN'}= basename($lib_semisync_slave_plugin); - $ENV{'SEMISYNC_PLUGIN_OPT'}= "--plugin-dir=".dirname($lib_semisync_master_plugin); - } - else - { - $ENV{'SEMISYNC_MASTER_PLUGIN'}= ""; - $ENV{'SEMISYNC_SLAVE_PLUGIN'}= ""; - $ENV{'SEMISYNC_PLUGIN_OPT'}="--plugin-dir="; - } - } - - # ---------------------------------------------------- - # Add the paths where mysqld will find archive/blackhole/federated plugins. - # ---------------------------------------------------- - $ENV{'ARCHIVE_PLUGIN_DIR'} = - dirname(find_plugin("ha_archive", "storage/archive")); - $ENV{'BLACKHOLE_PLUGIN_DIR'} = - dirname(find_plugin("ha_blackhole", "storage/blackhole")); - $ENV{'FEDERATED_PLUGIN_DIR'} = - dirname(find_plugin("ha_federated", "storage/federated")); - - # ---------------------------------------------------- - # Add the path where mysqld will find mypluglib.so - # ---------------------------------------------------- - - my ($lib_simple_parser) = find_plugin("mypluglib", "plugin/fulltext"); - - $ENV{'MYPLUGLIB_SO'}="'".basename($lib_simple_parser)."'"; - $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 diff --git a/mysql-test/suite/bugs/t/bug57108.test b/mysql-test/suite/bugs/t/bug57108.test index 1006a7b30f1..56acd7fe7bd 100644 --- a/mysql-test/suite/bugs/t/bug57108.test +++ b/mysql-test/suite/bugs/t/bug57108.test @@ -5,7 +5,7 @@ # switched directory after starting the server and am using a relative # --defaults-file. --replace_regex /\.dll/.so/ -eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO; +eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN'; --query_vertical SELECT @@global.connect_timeout AS connect_timeout, @@global.local_infile AS local_infile diff --git a/mysql-test/t/bug46261.test b/mysql-test/t/bug46261.test index 67bdc995850..e0eae9b86fb 100644 --- a/mysql-test/t/bug46261.test +++ b/mysql-test/t/bug46261.test @@ -7,7 +7,7 @@ --replace_regex /\.dll/.so/ --error ER_OPTION_PREVENTS_STATEMENT -eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO; +eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN'; --replace_regex /\.dll/.so/ --error ER_OPTION_PREVENTS_STATEMENT diff --git a/mysql-test/t/fulltext_plugin.test b/mysql-test/t/fulltext_plugin.test index 25e4302ef0d..b591a7949e5 100644 --- a/mysql-test/t/fulltext_plugin.test +++ b/mysql-test/t/fulltext_plugin.test @@ -4,7 +4,7 @@ # BUG#39746 - Debug flag breaks struct definition (server crash) # --replace_regex /\.dll/.so/ -eval INSTALL PLUGIN simple_parser SONAME $MYPLUGLIB_SO; +eval INSTALL PLUGIN simple_parser SONAME '$SIMPLE_PARSER'; CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser); ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser; DROP TABLE t1; diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test index 0bf86b47dd7..117eaf1e19b 100644 --- a/mysql-test/t/plugin.test +++ b/mysql-test/t/plugin.test @@ -5,15 +5,15 @@ CREATE TABLE t1(a int) ENGINE=EXAMPLE; DROP TABLE t1; --replace_regex /\.dll/.so/ -eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO; +eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN'; --replace_regex /\.dll/.so/ --error 1125 -eval INSTALL PLUGIN EXAMPLE SONAME $HA_EXAMPLE_SO; +eval INSTALL PLUGIN EXAMPLE SONAME '$EXAMPLE_PLUGIN'; UNINSTALL PLUGIN example; --replace_regex /\.dll/.so/ -eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO; +eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN'; CREATE TABLE t1(a int) ENGINE=EXAMPLE; @@ -41,7 +41,7 @@ UNINSTALL PLUGIN non_exist; --echo # to impossible int val --echo # --replace_regex /\.dll/.so/ -eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO; +eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN'; SET GLOBAL example_enum_var= e1; SET GLOBAL example_enum_var= e2; @@ -56,7 +56,7 @@ UNINSTALL PLUGIN example; # Bug #32757 hang with sql_mode set when setting some global variables # --replace_regex /\.dll/.so/ -eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO; +eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN'; select @@session.sql_mode into @old_sql_mode; diff --git a/mysql-test/t/plugin_auth_qa_2-master.opt b/mysql-test/t/plugin_auth_qa_2-master.opt index c29153ac95b..354907b9366 100644 --- a/mysql-test/t/plugin_auth_qa_2-master.opt +++ b/mysql-test/t/plugin_auth_qa_2-master.opt @@ -1,2 +1,2 @@ -$PLUGIN_AUTH_OPT -$PLUGIN_AUTH_INTERFACE +$PLUGIN_AUTH_INTERFACE_OPT +$PLUGIN_AUTH_INTERFACE_LOAD diff --git a/mysql-test/t/plugin_auth_qa_3-master.opt b/mysql-test/t/plugin_auth_qa_3-master.opt index 5cc2af0a358..e1754862a4d 100644 --- a/mysql-test/t/plugin_auth_qa_3-master.opt +++ b/mysql-test/t/plugin_auth_qa_3-master.opt @@ -1,2 +1,2 @@ -$PLUGIN_AUTH_OPT -$PLUGIN_AUTH_SERVER +$PLUGIN_AUTH_SERVER_OPT +$PLUGIN_AUTH_SERVER_LOAD diff --git a/mysql-test/t/plugin_not_embedded.test b/mysql-test/t/plugin_not_embedded.test index 40024efcaad..a2b7b8a0fe4 100644 --- a/mysql-test/t/plugin_not_embedded.test +++ b/mysql-test/t/plugin_not_embedded.test @@ -8,7 +8,7 @@ GRANT INSERT ON mysql.plugin TO bug51770@localhost; connect(con1,localhost,bug51770,,); --replace_regex /\.dll/.so/ -eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO; +eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN'; --error ER_TABLEACCESS_DENIED_ERROR UNINSTALL PLUGIN example; connection default; @@ -25,7 +25,7 @@ DROP USER bug51770@localhost; # The bug consisted of not recognizing / on Windows, so checking / on # all platforms should cover this case. -let $path = `select CONCAT_WS('/', '..', $HA_EXAMPLE_SO)`; +let $path = `select CONCAT_WS('/', '..', '$EXAMPLE_PLUGIN')`; --replace_regex /\.dll/.so/ --error ER_UDF_NO_PATHS eval INSTALL PLUGIN example SONAME '$path'; From 596c881092f7a973f13ab8d110ab538da4cda8eb Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 11 Jan 2011 15:00:21 +0100 Subject: [PATCH 5/9] Bug #59002 Please make mtr print correct file and line number when tests fail Followup: had forgotten to update mysqltest.test due to changed output - duh! --- mysql-test/r/mysqltest.result | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 00e4a598539..a16b3ec2670 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -318,8 +318,26 @@ drop table t1; mysqltest: At line 1: Error running query 'failing query': 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing query' at line 1 mysqltest: At line 1: Missing required argument 'filename' to command 'source' mysqltest: At line 1: Could not open './non_existingFile' for reading, errno: 2 -mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep -mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql": At line 1: query 'garbage ' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": +included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: +included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: +included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: +included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: +included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: +included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: +included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: +included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: +included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: +included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: +included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: +included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: +included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: +included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: +included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: +At line 1: Source directives are nesting too deep +mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql": +included from MYSQLTEST_VARDIR/tmp/error.sql at line 1: +At line 1: query 'garbage ' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 2 = outer loop variable after while here is the sourced script @@ -413,7 +431,9 @@ Beta is true while with string, only once 1 Testing while with not -mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest_while.inc": At line 64: Nesting too deeply +mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest_while.inc": +included from MYSQLTEST_VARDIR/tmp/mysqltest_while.inc at line 65: +At line 64: Nesting too deeply mysqltest: At line 1: missing '(' in while mysqltest: At line 1: missing ')' in while mysqltest: At line 1: Missing '{' after while. Found "dec $i" @@ -462,8 +482,12 @@ mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: 1 mysqltest: At line 1: Illegal argument for port: 'illegal_port' mysqltest: At line 1: Illegal option to connect: SMTP 200 connects succeeded -mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 3: connection 'test_con1' not found in connection pool -mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 2: Connection test_con1 already exists +mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": +included from MYSQLTEST_VARDIR/tmp/mysqltest.sql at line 3: +At line 3: connection 'test_con1' not found in connection pool +mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": +included from MYSQLTEST_VARDIR/tmp/mysqltest.sql at line 2: +At line 2: Connection test_con1 already exists show tables; ERROR 3D000: No database selected connect con1,localhost,root,,; From 3261c83722b228c164a744a88df20c1c93d4b766 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 11 Jan 2011 15:16:29 +0100 Subject: [PATCH 6/9] Bug #59216 mysql test suite can not run indiviual tests in engines/funcs suite Test name spec would be cut at last / Only do this when .test file name given, not suite. --- mysql-test/lib/mtr_cases.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index f1f1ac35dcd..856982e98a1 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -229,8 +229,11 @@ sub collect_test_cases ($$$$) { sub split_testname { my ($test_name)= @_; - # Get rid of directory part and split name on .'s - my @parts= split(/\./, basename($test_name)); + # If .test file name is used, get rid of directory part + $test_name= basename($test_name) if $test_name =~ /\.test$/; + + # Now split name on .'s + my @parts= split(/\./, $test_name); if (@parts == 1){ # Only testname given, ex: alias From 443b3bed2f077b86d6e4d5e4f87c96b0c571d595 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 11 Jan 2011 15:23:39 +0100 Subject: [PATCH 7/9] Bug #59153 mysqltest produces a valgrind warning when the running test fails Local variable ds_warnings in run_query not cleared. But when we call die() we don't have access to it. Set global var. to point to it when allocated. --- client/mysqltest.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 63e74cf0b32..6d1630ebdaa 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -468,6 +468,8 @@ TYPELIB command_typelib= {array_elements(command_names),"", command_names, 0}; DYNAMIC_STRING ds_res; +/* Points to ds_warning in run_query, so it can be freed */ +DYNAMIC_STRING *ds_warn= 0; char builtin_echo[FN_REFLEN]; @@ -1275,6 +1277,8 @@ void free_used_memory() my_free(embedded_server_args[--embedded_server_arg_count]); delete_dynamic(&q_lines); dynstr_free(&ds_res); + if (ds_warn) + dynstr_free(ds_warn); free_all_replace(); my_free(opt_pass); free_defaults(default_argv); @@ -7693,6 +7697,8 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags) die ("Cannot reap on a connection without pending send"); init_dynamic_string(&ds_warnings, NULL, 0, 256); + ds_warn= &ds_warnings; + /* Evaluate query if this is an eval command */ @@ -7850,6 +7856,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags) ds, &ds_warnings); dynstr_free(&ds_warnings); + ds_warn= 0; if (command->type == Q_EVAL || command->type == Q_SEND_EVAL) dynstr_free(&eval_query); From a27de1946855143ec40374d57d6a1999841cb4a4 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 12 Jan 2011 10:27:46 +0100 Subject: [PATCH 8/9] Bug #59182 output of mysql-test-run.pl - mismatch between col names and actual col contents New patch, avoid global $opt_parallel I still prefer not to print workerid when not doing parallel --- mysql-test/lib/mtr_report.pm | 15 ++++++++++----- mysql-test/mysql-test-run.pl | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index 3be679858bc..cd3f9ce1041 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -396,7 +396,7 @@ sub mtr_report_stats ($$;$) { ############################################################################## sub mtr_print_line () { - print '-' x 60 . "\n"; + print '-' x 74 . "\n"; } @@ -406,13 +406,18 @@ sub mtr_print_thick_line { } -sub mtr_print_header () { +sub mtr_print_header ($) { + my ($wid) = @_; print "\n"; printf "TEST"; - print " " x 38; + if ($wid) { + print " " x 34 . "WORKER "; + } else { + print " " x 38; + } print "RESULT "; - print "TIME (ms)" if $timer; - print "\n"; + print "TIME (ms) or " if $timer; + print "COMMENT\n"; mtr_print_line(); print "\n"; } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index e2bb5d24205..83f6a83682d 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -438,7 +438,7 @@ sub main { mtr_report(); mtr_print_thick_line(); - mtr_print_header(); + mtr_print_header($opt_parallel > 1); mark_time_used('init'); From add4385d8d4014992ce35695b40004a88c507109 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 12 Jan 2011 14:17:54 +0100 Subject: [PATCH 9/9] Bug #58841 Generalise handling of plugins in MTR mysql-test-run.pl script Follow-up fix: mtr died if trying to run semisync test w/o the plugin --- mysql-test/mysql-test-run.pl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 83f6a83682d..b786066faf6 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2051,10 +2051,7 @@ sub environment_setup { read_plugin_defs("include/plugin.defs"); # Simplify reference to semisync plugins - if ($ENV{'SEMISYNC_MASTER_PLUGIN'}) - { - $ENV{'SEMISYNC_PLUGIN_OPT'}= $ENV{'SEMISYNC_MASTER_PLUGIN_OPT'}; - } + $ENV{'SEMISYNC_PLUGIN_OPT'}= $ENV{'SEMISYNC_MASTER_PLUGIN_OPT'}; # -------------------------------------------------------------------------- # Valgrind need to be run with debug libraries otherwise it's almost