diff --git a/client/mysqltest.c b/client/mysqltest.c index 04226719888a1ec4864f1c247c8f61c1aa4d9801..cca2420d49847f98f10492088da7fd31524fbf1f 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -2670,7 +2670,7 @@ void do_copy_file(struct st_command *command) command command handle DESCRIPTION - chmod_file <octal> <file_name> + chmod <octal> <file_name> Change file permission of <file_name> */ diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 3d5752b4ec88fa7105f232ffd034aa95ee6bc83e..d17a1c6f0dc1a63a8443515a0cfe315aaad167a9 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -33,16 +33,14 @@ my $skip_test; sub init_pattern { my ($from, $what)= @_; - if ( $from =~ /[a-z0-9]/ ) { + if ( $from =~ /^[a-z0-9]$/ ) { # Does not contain any regex, make the pattern match # beginning of string $from= "^$from"; } - else { - # Check that pattern is a valid regex - eval { "" =~/$from/; 1 } or - mtr_error("Invalid regex '$from' passed to $what\nPerl says: $@"); - } + # Check that pattern is a valid regex + eval { "" =~/$from/; 1 } or + mtr_error("Invalid regex '$from' passed to $what\nPerl says: $@"); return $from; } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 2b4156654741283f7c35ff15ea20c3d9fb856e01..5cf00fb653cc4ab457970a65f6306d7c49e73ba5 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3761,6 +3761,16 @@ sub mysqld_arguments ($$$$) { # see BUG#28359 mtr_add_arg($args, "%s--connect-timeout=60", $prefix); + + # When mysqld is run by a root user(euid is 0), it will fail + # to start unless we specify what user to run as. If not running + # as root it will be ignored, see BUG#30630 + my $euid= $>; + if (!$glob_win32 and $euid == 0 and + grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt) == 0) { + mtr_add_arg($args, "%s--user=root"); + } + if ( $opt_valgrind_mysqld ) { mtr_add_arg($args, "%s--skip-safemalloc", $prefix);