diff options
Diffstat (limited to 'mysql-test')
120 files changed, 857 insertions, 667 deletions
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 991c8116f1b..c74a042cab0 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -63,13 +63,14 @@ nobase_test_DATA = \ lib/My/SafeProcess.pm \ lib/My/File/Path.pm \ lib/My/SysInfo.pm \ + lib/My/Suite.pm \ lib/My/CoreDump.pm \ lib/My/SafeProcess/Base.pm \ lib/My/SafeProcess/safe_process.pl SUBDIRS = lib/My/SafeProcess -EXTRA_DIST = README \ +EXTRA_DIST = README README.suites \ $(test_SCRIPTS) \ $(nobase_test_DATA) @@ -101,7 +102,7 @@ TEST_DIRS = t r include std_data std_data/parts collections \ suite/ndb suite/ndb/t suite/ndb/r \ suite/rpl_ndb suite/rpl_ndb/t suite/rpl_ndb/r \ suite/parts suite/parts/t suite/parts/r suite/parts/inc \ - suite/pbxt/t suite/pbxt/r \ + suite/pbxt/t suite/pbxt/r suite/pbxt \ suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include \ suite/vcol suite/vcol/t suite/vcol/r suite/vcol/inc \ suite/oqgraph suite/oqgraph/t suite/oqgraph/r suite/oqgraph/include \ diff --git a/mysql-test/README b/mysql-test/README index 77b398ebf39..3c8303ca070 100644 --- a/mysql-test/README +++ b/mysql-test/README @@ -18,7 +18,7 @@ the test suite expects you to provide the names of the tests to run. For example, here is the command to run the "alias" and "analyze" tests with an external server: -mysql-test-run --extern alias analyze +mysql-test-run --extern socket=/tmp/mysql.sock alias analyze To match your setup, you might also need to provide --socket, --user, and other relevant options. diff --git a/mysql-test/README.suites b/mysql-test/README.suites new file mode 100644 index 00000000000..99155f37485 --- /dev/null +++ b/mysql-test/README.suites @@ -0,0 +1,138 @@ +These are the assorted notes that will be turned into a manual eventually. + +========================== +Tests are organized in suites. +A "suite" is a subdirectory inside, one of, + + <basedir>/mysql-test/suite + <basedir>/mysql-test + <basedir>/share/mysql-test/suite + <basedir>/share/mysql-test + <basedir>/share/mysql/mysql-test/suite + <basedir>/share/mysql/mysql-test + <basedir>/storage/*/mysql-test-suites + +This is supposed to cover running mtr from a source directory and installed. + +========================== +A suite contains *.test and *.result files. They can be in the t/ and r/ +subdirectories under the suitedir or directly in the suitedir +(that is suitedir/t/*.test or suitedir/*.test, same for *.result)) + +========================== +A suite can contain a suite.opt file - at the same location where .test +files are. As usual, the .opt file can use $-substitutions for the +environment variables. + +Usually, using my.cnf template (see below) is preferrable. +========================== +A suite can have suite.pm file in the suitedir. It must declare a +package that inherits from My::Suite. + +The suite.pm needs to have @ISA=qw(My::Suite) and it must end +with bless {}; - that is it must return an object of that class. +It can also return a string - in this case all tests in the suite +will be skipped, with this string being printed as a reason. + +A suite class can define config_files() and servers() methods. + +A config_files method returns a list of additional config files (besides +my.cnf), that this suite needs to be created. For every file it specifies +a function that will create it, when given a My::Config object. For example: + + sub config_files { ( 'config.ini' => \&write_ini, + 'new.conf' => \&do_new_conf ) } + +A servers method returns a list of processes that needs to be started for +this suite. A process is specified as a pair (regex, hash). A regex must +match a section in the my.cnf template (for example, qr/mysqld\./ corresponds +to all mysqld processes), a hash contains these options: + + SORT => a number, processes are started in the order of increasing SORT + values (and stopped in the reverse order). mysqld has number 300. + START => a function to start a process. It takes two arguments, + My::Config::Group and My::Test. If START is undefined the process + will not be started. + WAIT => a function waits for the process to be started. It takes + My::Config::Group as an argument. Internallys mtr first invokes + START for all processes, then WAIT for all started processes. + +example: sub servers { ( qr/^foo$/ => { SORT => 200, + START => \&start_foo, + WAIT => \&wait_foo } ) } + +See sphinx suite for an example. + +========================== +A suite can have my.cnf template file in the suitedir. +A my.cnf template uses a normal my.cnf syntax - groups, options, +and values - with templating extensions. They are + +* There can be groups with non-standard names, not used by mysqld. + These groups may be used by the suite.pm file somehow. + For example, they can be written to the additional config files. + See sphinx suite for an example. + +* There can be ENV group. It sets values for the environment variables. + +* Values can refer to each other - they will be expanded as needed. + A reference to a value of an option looks like @groupname.optionname. + For example + + [mysqld.2] + master-port= @mysqld.1.port + + it sets the master-port in the mysqld.2 group to the value of + port in the mysqld.1 group. + +* An option name may start from '#'. In the resulting my.cnf it will look + like a comment, but it still can be referred to. For example: + + [example] + #foo = localhost:@mysqld.1.port + bar = http://@example.#foo/index.html + +* There are two special - in this regard - groups. + + Via the ENV group one can refer to any environment variable, not only + to values in the [ENV] group of my.cnf file. + + Via the OPT group one can refer to special values: + @OPT.vardir - a path to vardir + @OPT.port - a new port number is reserved out of the pool. It will not + match any other port number used by this test run. + See sphinx suite for an example. + +Most probably a suite my.cnf will need to start from + + !include include/default_my.cnf + +and then modify the configuration as necessary. +========================== + +A suite can have combinations file in the suitedir. It uses my.cnf syntax +but it cannot use @-substitutions. Instead, it can use $-substitutions for +the environment variables. Because the combination options will not be +merged to a my.cnf, but will be added to the command line. Example: + + [conf1] + opt1=val1 + + [conf2] + opt1=val2 + opt2=$HAVE_SOMETHING + +Such a file will cause every test from the suite to be run twice - once +with mysqld using --opt1=val1 and the other one with mysqld using +--opt1=val2 --opt2=$HAVE_SOMETHING + +One can limit mtr run to a subset of combinations by setting environment +variable SUITENAME_COMBINATIONS to the ':'-separated set of combination +names. E.g. + + RPL_COMBINATIONS=mix:row ./mtr --suite rpl + +See innodb_plugin suite for an example of how suite.pm may set this variable +to exclude unsupported configurations. +========================== + diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf index d77fee0e200..17a418ff7b5 100644 --- a/mysql-test/include/default_my.cnf +++ b/mysql-test/include/default_my.cnf @@ -6,9 +6,6 @@ # Run the master.sh script before starting this process #!run-master-sh -log-bin= master-bin - - [mysqlbinlog] disable-force-if-open diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index c93762f6c25..e46c3bc3c17 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -13,9 +13,10 @@ key_buffer_size= 1M sort_buffer= 256K max_heap_table_size= 1M +loose-skip-innodb +loose-skip-pbxt + loose-innodb_data_file_path= ibdata1:10M:autoextend slave-net-timeout=120 -log-bin=mysqld-bin - diff --git a/mysql-test/include/have_binlog_format_mixed.opt b/mysql-test/include/have_binlog_format_mixed.opt new file mode 100644 index 00000000000..01cf3e0520f --- /dev/null +++ b/mysql-test/include/have_binlog_format_mixed.opt @@ -0,0 +1 @@ +--binlog-format=mixed diff --git a/mysql-test/include/have_binlog_format_row.opt b/mysql-test/include/have_binlog_format_row.opt new file mode 100644 index 00000000000..83ed8522e72 --- /dev/null +++ b/mysql-test/include/have_binlog_format_row.opt @@ -0,0 +1 @@ +--binlog-format=row diff --git a/mysql-test/include/have_binlog_format_statement.opt b/mysql-test/include/have_binlog_format_statement.opt new file mode 100644 index 00000000000..0dac5e9fb9c --- /dev/null +++ b/mysql-test/include/have_binlog_format_statement.opt @@ -0,0 +1,2 @@ +--binlog-format=statement + diff --git a/mysql-test/include/have_exampledb.inc b/mysql-test/include/have_exampledb.inc deleted file mode 100644 index db3985e3c7c..00000000000 --- a/mysql-test/include/have_exampledb.inc +++ /dev/null @@ -1,4 +0,0 @@ -disable_query_log; ---require r/true.require -select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'example'; -enable_query_log; diff --git a/mysql-test/include/have_innodb.inc b/mysql-test/include/have_innodb.inc index 8944cc46f3e..c3c8b5cc4f2 100644 --- a/mysql-test/include/have_innodb.inc +++ b/mysql-test/include/have_innodb.inc @@ -1,4 +1,5 @@ -disable_query_log; ---require r/true.require -select (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` from information_schema.engines where engine = 'innodb'; -enable_query_log; +if (!`SELECT count(*) FROM information_schema.engines WHERE + (support = 'YES' OR support = 'DEFAULT') AND + engine = 'innodb'`){ + skip Needs innodb engine; +} diff --git a/mysql-test/include/have_innodb.opt b/mysql-test/include/have_innodb.opt new file mode 100644 index 00000000000..48457b17309 --- /dev/null +++ b/mysql-test/include/have_innodb.opt @@ -0,0 +1 @@ +--loose-innodb diff --git a/mysql-test/include/have_innodb_plugin.inc b/mysql-test/include/have_innodb_plugin.inc index 6b5fc29d459..5f67fb1f97d 100644 --- a/mysql-test/include/have_innodb_plugin.inc +++ b/mysql-test/include/have_innodb_plugin.inc @@ -1,4 +1,5 @@ -disable_query_log; ---require r/true.require -SELECT (plugin_library LIKE 'ha_innodb_plugin%' OR plugin_description LIKE '%xtradb%') AS `TRUE` FROM information_schema.plugins WHERE LOWER(plugin_name) = 'innodb' AND LOWER(plugin_status) = 'active'; -enable_query_log; +if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS + WHERE PLUGIN_NAME = 'innodb' AND PLUGIN_STATUS = 'active' AND + (PLUGIN_LIBRARY LIKE 'ha_innodb_plugin%' OR PLUGIN_DESCRIPTION LIKE '%xtradb%')`) { + skip Need InnoDB plugin or XtraDB; +} diff --git a/mysql-test/include/have_log_bin-master.opt b/mysql-test/include/have_log_bin-master.opt new file mode 100644 index 00000000000..9ce5d80d7e8 --- /dev/null +++ b/mysql-test/include/have_log_bin-master.opt @@ -0,0 +1 @@ +--log-bin=master-bin diff --git a/mysql-test/include/have_log_bin-slave.opt b/mysql-test/include/have_log_bin-slave.opt new file mode 100644 index 00000000000..92012982830 --- /dev/null +++ b/mysql-test/include/have_log_bin-slave.opt @@ -0,0 +1 @@ +--log-bin=slave-bin diff --git a/mysql-test/include/have_log_bin.inc b/mysql-test/include/have_log_bin.inc index 369af9b8e1d..e51205d25ad 100644 --- a/mysql-test/include/have_log_bin.inc +++ b/mysql-test/include/have_log_bin.inc @@ -6,6 +6,8 @@ # # source include/have_log_bin.inc; +source include/not_embedded.inc; + -- require r/have_log_bin.require disable_query_log; show variables like 'log_bin'; diff --git a/mysql-test/include/have_pbxt.opt b/mysql-test/include/have_pbxt.opt new file mode 100644 index 00000000000..54ba9495053 --- /dev/null +++ b/mysql-test/include/have_pbxt.opt @@ -0,0 +1 @@ +--loose-pbxt diff --git a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm index f8416e3df3a..0955c1bb190 100644 --- a/mysql-test/lib/My/Config.pm +++ b/mysql-test/lib/My/Config.pm @@ -6,7 +6,6 @@ use strict; use warnings; use Carp; - sub new { my ($class, $option_name, $option_value)= @_; my $self= bless { name => $option_name, @@ -61,7 +60,7 @@ sub insert { $option->{value}= $value; } else { - my $option= My::Config::Option->new($option_name, $value); + $option= My::Config::Option->new($option_name, $value); # Insert option in list push(@{$self->{options}}, $option); # Insert option in hash @@ -163,6 +162,62 @@ sub if_exist { return $option->value(); } +package My::Config::Group::ENV; +our @ISA=qw(My::Config::Group); + +use strict; +use warnings; +use Carp; + +sub new { + my ($class, $group_name)= @_; + bless My::Config::Group->new($group_name), $class; +} + +# +# Return value for an option in the group, fail if it does not exist +# +sub value { + my ($self, $option_name)= @_; + my $option= $self->option($option_name); + + if (! defined($option) and defined $ENV{$option_name}) { + my $value= $ENV{$option_name}; + $option= My::Config::Option->new($option_name, $value); + } + + croak "No option named '$option_name' in group '$self->{name}'" + if ! defined($option); + + return $option->value(); +} + +package My::Config::Group::OPT; +our @ISA=qw(My::Config::Group); + +use strict; +use warnings; +use Carp; + +sub new { + my ($class, $group_name)= @_; + bless My::Config::Group->new($group_name), $class; +} + +sub options { + my ($self)= @_; + () +} + +sub value { + my ($self, $option_name)= @_; + my $option= $self->option($option_name); + + croak "No option named '$option_name' in group '$self->{name}'" + if ! defined($option); + + return $option->value()->(); +} package My::Config; @@ -182,7 +237,10 @@ sub new { my ($class, $path)= @_; my $group_name= undef; - my $self= bless { groups => [] }, $class; + my $self= bless { groups => [ + My::Config::Group::ENV->new('ENV'), + My::Config::Group::OPT->new('OPT'), + ] }, $class; my $F= IO::File->new($path, "<") or croak "Could not open '$path': $!"; @@ -199,19 +257,13 @@ sub new { } # Magic #! comments - elsif ( $line =~ /^#\!/) { - my $magic= $line; + elsif ( $line =~ /^(#\!\S+)(?:\s*(.*?)\s*)?$/) { + my ($magic, $arg)= ($1, $2); croak "Found magic comment '$magic' outside of group" unless $group_name; #print "$magic\n"; - $self->insert($group_name, $magic, undef); - } - - # Comments - elsif ( $line =~ /^#/ || $line =~ /^;/) { - # Skip comment - next; + $self->insert($group_name, $magic, $arg); } # Empty lines @@ -236,7 +288,7 @@ sub new { } # <option> - elsif ( $line =~ /^([\@\w-]+)\s*$/ ) { + elsif ( $line =~ /^(#?[\w-]+)\s*$/ ) { my $option= $1; croak "Found option '$option' outside of group" @@ -247,7 +299,7 @@ sub new { } # <option>=<value> - elsif ( $line =~ /^([\@\w-]+)\s*=\s*(.*?)\s*$/ ) { + elsif ( $line =~ /^(#?[\w-]+)\s*=\s*(.*?)\s*$/ ) { my $option= $1; my $value= $2; @@ -256,10 +308,17 @@ sub new { #print "$option=$value\n"; $self->insert($group_name, $option, $value); - } else { - croak "Unexpected line '$line' found in '$path'"; } + # Comments + elsif ( $line =~ /^#/ || $line =~ /^;/) { + # Skip comment + next; + } + + else { + croak "Unexpected line '$line' found in '$path'"; + } } undef $F; # Close the file @@ -437,44 +496,4 @@ sub exists { return defined($option); } - -# Overload "to string"-operator with 'stringify' -use overload - '""' => \&stringify; - -# -# Return the config as a string in my.cnf file format -# -sub stringify { - my ($self)= @_; - my $res; - - foreach my $group ($self->groups()) { - $res .= "[$group->{name}]\n"; - - foreach my $option ($group->options()) { - $res .= $option->name(); - my $value= $option->value(); - if (defined $value) { - $res .= "=$value"; - } - $res .= "\n"; - } - $res .= "\n"; - } - return $res; -} - - -# -# Save the config to named file -# -sub save { - my ($self, $path)= @_; - my $F= IO::File->new($path, ">") - or croak "Could not open '$path': $!"; - print $F $self; - undef $F; # Close the file -} - 1; diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm index c70831ab4b9..d5414713262 100644 --- a/mysql-test/lib/My/ConfigFactory.pm +++ b/mysql-test/lib/My/ConfigFactory.pm @@ -57,16 +57,12 @@ sub fix_pidfile { sub fix_port { my ($self, $config, $group_name, $group)= @_; - my $hostname= $group->value('#host'); - return $self->{HOSTS}->{$hostname}++; + return $self->{PORT}++; } sub fix_host { my ($self)= @_; - # Get next host from HOSTS array - my @hosts= keys(%{$self->{HOSTS}});; - my $host_no= $self->{NEXT_HOST}++ % @hosts; - return $hosts[$host_no]; + 'localhost' } sub is_unique { @@ -229,7 +225,7 @@ if (IS_WINDOWS) sub fix_ndb_mgmd_port { my ($self, $config, $group_name, $group)= @_; my $hostname= $group->value('HostName'); - return $self->{HOSTS}->{$hostname}++; + return $self->{PORT}++; } @@ -428,20 +424,24 @@ sub post_check_embedded_group { sub resolve_at_variable { my ($self, $config, $group, $option)= @_; + local $_ = $option->value(); + my ($res, $after); - # Split the options value on last . - my @parts= split(/\./, $option->value()); - my $option_name= pop(@parts); - my $group_name= join('.', @parts); + while (m/(.*?)\@((?:\w+\.)+)(#?[-\w]+)/g) { + my ($before, $group_name, $option_name)= ($1, $2, $3); + $after = $'; + chop($group_name); - $group_name =~ s/^\@//; # Remove at + my $from_group= $config->group($group_name) + or croak "There is no group named '$group_name' that ", + "can be used to resolve '$option_name'"; - my $from_group= $config->group($group_name) - or croak "There is no group named '$group_name' that ", - "can be used to resolve '$option_name'"; + my $value= $from_group->value($option_name); + $res .= $before.$value; + } + $res .= $after; - my $from= $from_group->value($option_name); - $config->insert($group->name(), $option->name(), $from) + $config->insert($group->name(), $option->name(), $res) } @@ -453,7 +453,7 @@ sub post_fix_resolve_at_variables { next unless defined $option->value(); $self->resolve_at_variable($config, $group, $option) - if ($option->value() =~ /^\@/); + if ($option->value() =~ /\@/); } } } @@ -595,28 +595,18 @@ sub new_config { croak "you must pass '$required'" unless defined $args->{$required}; } - # Fill in hosts/port hash - my $hosts= {}; - my $baseport= $args->{baseport}; - $args->{hosts}= [ 'localhost' ] unless exists($args->{hosts}); - foreach my $host ( @{$args->{hosts}} ) { - $hosts->{$host}= $baseport; - } - # Open the config template my $config= My::Config->new($args->{'template_path'}); - my $extra_template_path= $args->{'extra_template_path'}; - if ($extra_template_path){ - $config->append(My::Config->new($extra_template_path)); - } my $self= bless { CONFIG => $config, ARGS => $args, - HOSTS => $hosts, - NEXT_HOST => 0, + PORT => $args->{baseport}, SERVER_ID => 1, }, $class; + # add auto-options + $config->insert('OPT', 'port' => sub { fix_port($self, $config) }); + $config->insert('OPT', 'vardir' => sub { shift->{ARGS}->{vardir} }); { # Run pre rules diff --git a/mysql-test/lib/My/Handles.pm b/mysql-test/lib/My/Handles.pm index 66ee22b403f..66ee22b403f 100755..100644 --- a/mysql-test/lib/My/Handles.pm +++ b/mysql-test/lib/My/Handles.pm diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm index b3409020f21..084ef408d5b 100644 --- a/mysql-test/lib/My/SafeProcess.pm +++ b/mysql-test/lib/My/SafeProcess.pm @@ -120,7 +120,7 @@ sub new { my $input = delete($opts{'input'}); my $output = delete($opts{'output'}); my $error = delete($opts{'error'}); - my $verbose = delete($opts{'verbose'}); + my $verbose = delete($opts{'verbose'}) || $::opt_verbose; my $nocore = delete($opts{'nocore'}); my $host = delete($opts{'host'}); my $shutdown = delete($opts{'shutdown'}); diff --git a/mysql-test/lib/My/Suite.pm b/mysql-test/lib/My/Suite.pm new file mode 100644 index 00000000000..69609e1c4f5 --- /dev/null +++ b/mysql-test/lib/My/Suite.pm @@ -0,0 +1,10 @@ +# A default suite class that is used for all suites without their owns suite.pm +# see README.suites for a description + +package My::Suite; + +sub config_files { () } +sub servers { () } + +bless { }; + diff --git a/mysql-test/lib/My/Test.pm b/mysql-test/lib/My/Test.pm index 21dd33336f6..c8bfbd34521 100644 --- a/mysql-test/lib/My/Test.pm +++ b/mysql-test/lib/My/Test.pm @@ -20,6 +20,12 @@ sub new { return $self; } +sub fullname { + my ($self)= @_; + $self->{name} . (defined $self->{combination} + ? " '$self->{combination}'" + : "") +} # # Return a unique key that can be used to diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index 7bdb0e37604..88e078baa7f 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -39,7 +39,6 @@ our $enable_disabled; our $default_storage_engine; our $opt_with_ndbcluster_only; our $defaults_file; -our $defaults_extra_file; our $quick_collect; sub collect_option { @@ -68,21 +67,10 @@ require "mtr_misc.pl"; my $do_test_reg; my $skip_test_reg; -# Related to adding InnoDB plugin combinations -my $lib_innodb_plugin; - # If "Quick collect", set to 1 once a test to run has been found. my $some_test_found; -sub find_innodb_plugin { - $lib_innodb_plugin= - my_find_file($::basedir, - ["storage/innodb_plugin", "storage/innodb_plugin/.libs", - "lib/mysql/plugin", "lib/plugin"], - ["ha_innodb_plugin.dll", "ha_innodb_plugin.so", - "ha_innodb_plugin.sl"], - NOT_REQUIRED); -} +my $default_suite_object = do 'My/Suite.pm'; sub init_pattern { my ($from, $what)= @_; @@ -116,8 +104,6 @@ sub collect_test_cases ($$$) { $do_test_reg= init_pattern($do_test, "--do-test"); $skip_test_reg= init_pattern($skip_test, "--skip-test"); - &find_innodb_plugin; - # If not reordering, we also shouldn't group by suites, unless # no test cases were named. # This also effects some logic in the loop following this. @@ -188,17 +174,17 @@ sub collect_test_cases ($$$) { my $opts= $tinfo->{'master_opt'} ? $tinfo->{'master_opt'} : []; push(@criteria, join("!", sort @{$opts}) . "~"); - $sort_criteria{$tinfo->{name}} = join(" ", @criteria); + $sort_criteria{$tinfo->fullname()} = join(" ", @criteria); } @$cases = sort { - $sort_criteria{$a->{'name'}} . $a->{'name'} cmp - $sort_criteria{$b->{'name'}} . $b->{'name'}; } @$cases; + $sort_criteria{$a->fullname()} . $a->fullname() cmp + $sort_criteria{$b->fullname()} . $b->fullname() } @$cases; # For debugging the sort-order # foreach my $tinfo (@$cases) # { - # print("$sort_criteria{$tinfo->{'name'}} -> \t$tinfo->{'name'}\n"); + # print $sort_criteria{$tinfo->fullname()}," -> \t",$tinfo->fullname(),"\n"; # } } @@ -310,6 +296,17 @@ sub collect_one_suite mtr_verbose("testdir: $testdir"); mtr_verbose("resdir: $resdir"); + # + # Load the Suite object + # + unless ($::suites{$suite}) { + if (-f "$suitedir/suite.pm") { + $::suites{$suite} = do "$suitedir/suite.pm"; + } else { + $::suites{$suite} = $default_suite_object; + } + } + # ---------------------------------------------------------------------- # Build a hash of disabled testcases for this suite # ---------------------------------------------------------------------- @@ -438,14 +435,16 @@ sub collect_one_suite { # Read combinations file in my.cnf format mtr_verbose("Read combinations file"); + my %env_filter = map { $_ => 1 } split /:/, $ENV{"\U${suite}_COMBINATIONS"}; my $config= My::Config->new($combination_file); foreach my $group ($config->groups()) { my $comb= {}; $comb->{name}= $group->name(); + next if %env_filter and not $env_filter{$comb->{name}}; foreach my $option ( $group->options() ) { push(@{$comb->{comb_opt}}, $option->option()); } - push(@combinations, $comb); + push(@combinations, $comb) if $comb->{comb_opt}; } } @@ -539,28 +538,7 @@ sub optimize_cases { # support it # ======================================================= #print "binlog_format: $binlog_format\n"; - if (defined $binlog_format ) - { - # ======================================================= - # Fixed --binlog-format=x specified on command line - # ======================================================= - if ( defined $tinfo->{'binlog_formats'} ) - { - #print "binlog_formats: ". join(", ", @{$tinfo->{binlog_formats}})."\n"; - - # The test supports different binlog formats - # check if the selected one is ok - my $supported= - grep { $_ eq $binlog_format } @{$tinfo->{'binlog_formats'}}; - if ( !$supported ) - { - $tinfo->{'skip'}= 1; - $tinfo->{'comment'}= - "Doesn't support --binlog-format='$binlog_format'"; - } - } - } - else + if (not defined $binlog_format ) { # ======================================================= # Use dynamic switching of binlog format @@ -623,10 +601,6 @@ sub optimize_cases { $tinfo->{'ndb_test'}= 1 if ( $default_engine =~ /^ndb/i ); - $tinfo->{'innodb_test'}= 1 - if ( $default_engine =~ /^innodb/i ); - $tinfo->{'pbxt_test'}= 1 - if ( $default_engine =~ /^pbxt/i ); } } @@ -758,7 +732,7 @@ sub collect_one_test_case { name => "$suitename.$tname", shortname => $tname, path => "$testdir/$filename", - + suite => $suitename, ); my $result_file= "$resdir/$tname.result"; @@ -880,7 +854,7 @@ sub collect_one_test_case { if ( -f "$testdir/$tname.slave-mi"); - tags_from_test_file($tinfo,"$testdir/${tname}.test"); + my @source_files = tags_from_test_file($tinfo,"$testdir/${tname}.test"); # Get default storage engine from suite.opt file @@ -897,12 +871,6 @@ sub collect_one_test_case { $tinfo->{'ndb_test'}= 1 if ( $local_default_storage_engine =~ /^ndb/i ); - $tinfo->{'innodb_test'}= 1 - if ( $local_default_storage_engine =~ /^innodb/i ); - - $tinfo->{'pbxt_test'}= 1 - if ( $local_default_storage_engine =~ /^pbxt/i ); - } if ( $tinfo->{'big_test'} and ! $::opt_big_test ) @@ -949,72 +917,6 @@ sub collect_one_test_case { } } - if ($tinfo->{'federated_test'}) - { - # This is a test that needs federated, enable it - push(@{$tinfo->{'master_opt'}}, "--loose-federated"); - push(@{$tinfo->{'slave_opt'}}, "--loose-federated"); - } - - if ( $tinfo->{'innodb_test'} ) - { - # This is a test that needs innodb - if ( $::mysqld_variables{'innodb'} eq "OFF" || - ! exists $::mysqld_variables{'innodb'} ) - { - # innodb is not supported, skip it - $tinfo->{'skip'}= 1; - $tinfo->{'comment'}= "No innodb support"; - return $tinfo; - } - } - elsif ( $tinfo->{'innodb_plugin_test'} ) - { - # This is a test that needs the innodb plugin - if (&find_innodb_plugin) - { - my $sep= (IS_WINDOWS) ? ';' : ':'; - my $plugin_filename= basename($lib_innodb_plugin); - my $plugin_list= - "innodb=$plugin_filename$sep" . - "innodb_trx=$plugin_filename$sep" . - "innodb_locks=$plugin_filename$sep" . - "innodb_lock_waits=$plugin_filename$sep" . - "innodb_cmp=$plugin_filename$sep" . - "innodb_cmp_reset=$plugin_filename$sep" . - "innodb_cmpmem=$plugin_filename$sep" . - "innodb_cmpmem_reset=$plugin_filename"; - - foreach my $k ('master_opt', 'slave_opt') { - push(@{$tinfo->{$k}}, '--ignore-builtin-innodb'); - push(@{$tinfo->{$k}}, '--plugin-dir=' . dirname($lib_innodb_plugin)); - push(@{$tinfo->{$k}}, "--plugin-load=$plugin_list"); - } - } - } - else - { - push(@{$tinfo->{'master_opt'}}, "--loose-skip-innodb"); - push(@{$tinfo->{'slave_opt'}}, "--loose-skip-innodb"); - } - - if ( $tinfo->{'need_binlog'} ) - { - if (grep(/^--skip-log-bin/, @::opt_extra_mysqld_opt) ) - { - $tinfo->{'skip'}= 1; - $tinfo->{'comment'}= "Test needs binlog"; - return $tinfo; - } - } - else - { - # Test does not need binlog, add --skip-binlog to - # the options used when starting - push(@{$tinfo->{'master_opt'}}, "--loose-skip-log-bin"); - push(@{$tinfo->{'slave_opt'}}, "--loose-skip-log-bin"); - } - if ( $tinfo->{'rpl_test'} ) { if ( $skip_rpl ) @@ -1085,28 +987,6 @@ sub collect_one_test_case { $tinfo->{template_path}= $config; } - if ( $tinfo->{'pbxt_test'} ) - { - # This is a test that needs pbxt - if ( $::mysqld_variables{'pbxt'} eq "OFF" || - ! exists $::mysqld_variables{'pbxt'} ) - { - # Engine is not supported, skip it - $tinfo->{'skip'}= 1; - return $tinfo; - } - } - else - { - # Only disable engine if it's on by default (to avoid warnings about - # not existing loose options - if ( $::mysqld_variables{'pbxt'} eq "ON") - { - push(@{$tinfo->{'master_opt'}}, "--loose-skip-pbxt"); - push(@{$tinfo->{'slave_opt'}}, "--loose-skip-pbxt"); - } - } - if ( $tinfo->{'example_plugin_test'} ) { if ( !$ENV{'HA_EXAMPLE_SO'} ) @@ -1127,27 +1007,27 @@ sub collect_one_test_case { } } - - # Set extra config file to use - if (defined $defaults_extra_file) { - $tinfo->{extra_template_path}= $defaults_extra_file; + if (not ref $::suites{$tinfo->{suite}}) + { + $tinfo->{'skip'}= 1; + $tinfo->{'comment'}= $::suites{$tinfo->{suite}}; + return $tinfo; } # ---------------------------------------------------------------------- - # Append mysqld extra options to both master and slave + # Append mysqld extra options to master and slave, as appropriate # ---------------------------------------------------------------------- + for (@source_files) { + s/\.\w+$//; + process_opts_file($tinfo, "$_.opt", 'master_opt'); + process_opts_file($tinfo, "$_.opt", 'slave_opt'); + process_opts_file($tinfo, "$_-master.opt", 'master_opt'); + process_opts_file($tinfo, "$_-slave.opt", 'slave_opt'); + } + push(@{$tinfo->{'master_opt'}}, @::opt_extra_mysqld_opt); push(@{$tinfo->{'slave_opt'}}, @::opt_extra_mysqld_opt); - # ---------------------------------------------------------------------- - # Add master opts, extra options only for master - # ---------------------------------------------------------------------- - process_opts_file($tinfo, "$testdir/$tname-master.opt", 'master_opt'); - - # ---------------------------------------------------------------------- - # Add slave opts, list of extra option only for slave - # ---------------------------------------------------------------------- - process_opts_file($tinfo, "$testdir/$tname-slave.opt", 'slave_opt'); return $tinfo; } @@ -1157,24 +1037,6 @@ sub collect_one_test_case { # the specified value in "tinfo" my @tags= ( - ["include/have_binlog_format_row.inc", "binlog_formats", ["row"]], - ["include/have_binlog_format_statement.inc", "binlog_formats", ["statement"]], - ["include/have_binlog_format_mixed.inc", "binlog_formats", ["mixed"]], - ["include/have_binlog_format_mixed_or_row.inc", - "binlog_formats", ["mixed", "row"]], - ["include/have_binlog_format_mixed_or_statement.inc", - "binlog_formats", ["mixed", "statement"]], - ["include/have_binlog_format_row_or_statement.inc", - "binlog_formats", ["row", "statement"]], - - ["include/have_log_bin.inc", "need_binlog", 1], - - ["include/have_innodb.inc", "innodb_test", 1], - ["include/have_innodb_plugin.inc", "innodb_plugin_test", 1], - ["include/have_real.inc", "innodb_test", 1], - ["include/have_real_innodb_plugin.inc", "innodb_plugin_test", 1], - ["include/have_xtradb.inc", "innodb_test", 1], - ["include/have_pbxt.inc", "pbxt_test", 1], ["include/big_test.inc", "big_test", 1], ["include/have_debug.inc", "need_debug", 1], ["include/have_ndb.inc", "ndb_test", 1], @@ -1182,7 +1044,6 @@ my @tags= ["include/master-slave.inc", "rpl_test", 1], ["include/ndb_master-slave.inc", "rpl_test", 1], ["include/ndb_master-slave.inc", "ndb_test", 1], - ["federated.inc", "federated_test", 1], ["include/not_embedded.inc", "not_embedded", 1], ["include/not_valgrind.inc", "not_valgrind", 1], ["include/have_example_plugin.inc", "example_plugin_test", 1], @@ -1196,6 +1057,7 @@ sub tags_from_test_file { my $file= shift; #mtr_verbose("$file"); my $F= IO::File->new($file) or mtr_error("can't open file \"$file\": $!"); + my @all_files=($file); while ( my $line= <$F> ) { @@ -1231,13 +1093,13 @@ sub tags_from_test_file { # Only source the file if it exists, we may get # false positives in the regexes above if someone # writes "source nnnn;" in a test case(such as mysqltest.test) - tags_from_test_file($tinfo, $sourced_file); + unshift @all_files, tags_from_test_file($tinfo, $sourced_file); last; } } } - } + @all_files; } sub unspace { @@ -1250,6 +1112,7 @@ sub unspace { sub opts_from_file ($) { my $file= shift; + local $_; open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!"); my @args; diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index f6a6a2b63b5..c13e6a93319 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -61,14 +61,10 @@ sub _name { sub _mtr_report_test_name ($) { my $tinfo= shift; - my $tname= $tinfo->{name}; + my $tname= $tinfo->fullname(); return unless defined $verbose; - # Add combination name if any - $tname.= " '$tinfo->{combination}'" - if defined $tinfo->{combination}; - print _name(). _timestamp(); printf "%-40s ", $tname; my $worker = $tinfo->{worker}; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 678f5ff23bf..0d673c87c4c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -130,7 +130,7 @@ my $path_config_file; # The generated config file, var/my.cnf # executables will be used by the test suite. our $opt_vs_config = $ENV{'MTR_VS_CONFIG'}; -my $DEFAULT_SUITES= "main,binlog,federated,rpl,maria,parts,innodb,innodb_plugin,percona,vcol,oqgraph"; +my $DEFAULT_SUITES= "main,binlog,federated,rpl,maria,parts,innodb,innodb_plugin,percona,vcol,oqgraph,ndb"; my $opt_suites; our $opt_verbose= 0; # Verbose output, enable with --verbose @@ -257,6 +257,8 @@ our $debug_compiled_binaries; our %mysqld_variables; +our %suites; + my $source_dist= 0; my $opt_max_save_core= env_or_val(MTR_MAX_SAVE_CORE => 5); @@ -711,6 +713,8 @@ sub run_test_server ($$$) { $next= splice(@$tests, $second_best, 1); } + xterm_stat(scalar(@$tests)); + if ($next) { #$next->print_test(); $next->write_test($sock, 'TESTCASE'); @@ -807,7 +811,7 @@ sub run_worker ($) { # We need to gracefully shut down the servers to see any # Valgrind memory leak errors etc. since last server restart. if ($opt_warnings) { - stop_servers(all_servers()); + stop_servers(reverse all_servers()); if(check_warnings_post_shutdown($server)) { # Warnings appeared in log file(s) during final server shutdown. exit(1); @@ -1592,7 +1596,7 @@ sub collect_mysqld_features { my $cmd= join(" ", $exe_mysqld, @$args); my $list= `$cmd`; - print "cmd: $cmd\n"; + mtr_verbose("cmd: $cmd"); foreach my $line (split('\n', $list)) { @@ -2490,7 +2494,7 @@ sub check_ndbcluster_support ($) { } -sub ndbcluster_wait_started($$){ +sub ndbcluster_wait_started { my $cluster= shift; my $ndb_waiter_extra_opt= shift; my $path_waitlog= join('/', $opt_vardir, $cluster->name(), "ndb_waiter.log"); @@ -2658,7 +2662,7 @@ sub ndbd_start { sub ndbcluster_start ($) { - my $cluster= shift; + my ($cluster) = @_; mtr_verbose("ndbcluster_start '".$cluster->name()."'"); @@ -2678,6 +2682,109 @@ sub ndbcluster_start ($) { } +sub mysql_server_start($) { + my ($mysqld, $tinfo) = @_; + + if ( $mysqld->{proc} ) + { + # Already started + + # Write start of testcase to log file + mark_log($mysqld->value('#log-error'), $tinfo); + + return; + } + + my $datadir= $mysqld->value('datadir'); + if (not $opt_start_dirty) + { + + my @options= ('log-bin', 'relay-log'); + foreach my $option_name ( @options ) { + next unless $mysqld->option($option_name); + + my $file_name= $mysqld->value($option_name); + next unless + defined $file_name and + -e $file_name; + + mtr_debug(" -removing '$file_name'"); + unlink($file_name) or die ("unable to remove file '$file_name'"); + } + + if (-d $datadir ) { + preserve_error_log($mysqld); + mtr_verbose(" - removing '$datadir'"); + rmtree($datadir); + } + } + + my $mysqld_basedir= $mysqld->value('basedir'); + if ( $basedir eq $mysqld_basedir ) + { + if (! $opt_start_dirty) # If dirty, keep possibly grown system db + { + # Copy datadir from installed system db + for my $path ( "$opt_vardir", "$opt_vardir/..") { + my $install_db= "$path/install.db"; + copytree($install_db, $datadir) + if -d $install_db; + } + mtr_error("Failed to copy system db to '$datadir'") + unless -d $datadir; + } + } + else + { + mysql_install_db($mysqld); # For versional testing + + mtr_error("Failed to install system db to '$datadir'") + unless -d $datadir; + + } + restore_error_log($mysqld); + + # Create the servers tmpdir + my $tmpdir= $mysqld->value('tmpdir'); + mkpath($tmpdir) unless -d $tmpdir; + + # Write start of testcase to log file + mark_log($mysqld->value('#log-error'), $tinfo); + + # Run <tname>-master.sh + if ($mysqld->option('#!run-master-sh') and + run_sh_script($tinfo->{master_sh}) ) + { + $tinfo->{'comment'}= "Failed to execute '$tinfo->{master_sh}'"; + return 1; + } + + # Run <tname>-slave.sh + if ($mysqld->option('#!run-slave-sh') and + run_sh_script($tinfo->{slave_sh})) + { + $tinfo->{'comment'}= "Failed to execute '$tinfo->{slave_sh}'"; + return 1; + } + + if (!$opt_embedded_server) + { + my $extra_opts= get_extra_opts($mysqld, $tinfo); + mysqld_start($mysqld,$extra_opts); + + # Save this test case information, so next can examine it + $mysqld->{'started_tinfo'}= $tinfo; + } +} + +sub mysql_server_wait { + my ($mysqld) = @_; + + return not sleep_until_file_created($mysqld->value('pid-file'), + $opt_start_timeout, + $mysqld->{'proc'}); +} + sub create_config_file_for_extern { my %opts= ( @@ -3452,9 +3559,82 @@ sub restart_forced_by_test # Return timezone value of tinfo or default value sub timezone { my ($tinfo)= @_; - return $tinfo->{timezone} || "DEFAULT"; + local $_ = $tinfo->{timezone}; + return 'DEFAULT' unless defined $_; + s/\$\{(\w+)\}/envsubst($1)/ge; + s/\$(\w+)/envsubst($1)/ge; + $_; +} + +sub mycnf_create { + my ($config) = @_; + my $res; + + foreach my $group ($config->groups()) { + $res .= "[$group->{name}]\n"; + + foreach my $option ($group->options()) { + $res .= $option->name(); + my $value= $option->value(); + if (defined $value) { + $res .= "=$value"; + } + $res .= "\n"; + } + $res .= "\n"; + } + $res; +} + +sub config_files($) { + my ($tinfo) = @_; + ( + 'my.cnf' => \&mycnf_create, + $suites{$tinfo->{suite}}->config_files() + ); +} + +sub _like { return $config ? $config->like($_[0]) : (); } +sub mysqlds { return _like('mysqld\.'); } +sub ndbds { return _like('cluster_config\.ndbd\.');} +sub ndb_mgmds { return _like('cluster_config\.ndb_mgmd\.'); } + +sub fix_servers($) { + my ($tinfo) = @_; + return () unless $config; + my %servers = ( + qr/mysqld\./ => { + SORT => 300, + START => \&mysql_server_start, + WAIT => \&mysql_server_wait, + }, + qr/mysql_cluster\./ => { + SORT => 200, + START => \&ndbcluster_start, + WAIT => \&ndbcluster_wait_started, + }, + qr/cluster_config\.ndb_mgmd\./ => { + SORT => 210, + START => undef, + }, + qr/cluster_config\.ndbd\./ => { + SORT => 220, + START => undef, + }, + $suites{$tinfo->{suite}}->servers() + ); + for ($config->groups()) { + while (my ($re,$prop) = each %servers) { + @$_{keys %$prop} = values %$prop if $_->{name} =~ /^$re/; + } + } } +sub all_servers { + return unless $config; + ( sort { $a->{SORT} <=> $b->{SORT} } + grep { defined $_->{SORT} } $config->groups() ); +} # Storage for changed environment variables my %old_env; @@ -3497,7 +3677,7 @@ sub run_testcase ($$) { if ( @restart != 0) { # Remember that we restarted for this test case (count restarts) $tinfo->{'restarted'}= 1; - stop_servers(@restart ); + stop_servers(reverse @restart); if ($opt_warnings) { check_warnings_post_shutdown($server_socket); } @@ -3533,7 +3713,6 @@ sub run_testcase ($$) { vardir => $opt_vardir, tmpdir => $opt_tmpdir, baseport => $baseport, - #hosts => [ 'host1', 'host2' ], user => $opt_user, password => '', ssl => $opt_ssl_supported, @@ -3541,8 +3720,16 @@ sub run_testcase ($$) { } ); - # Write the new my.cnf - $config->save($path_config_file); + fix_servers($tinfo); + + # Write config files: + my %config_files = config_files($tinfo); + while (my ($file, $generate) = each %config_files) { + my ($path) = "$opt_vardir/$file"; + open (F, '>', $path) or die "Could not open '$path': $!"; + print F &$generate($config); + close F; + } # Remember current config so a restart can occur when a test need # to use a different one @@ -3685,7 +3872,7 @@ sub run_testcase ($$) { if ($opt_warnings) { # Checking error logs for warnings, so need to stop server # gracefully so that memory leaks etc. can be properly detected. - stop_servers(all_servers()); + stop_servers(reverse all_servers()); check_warnings_post_shutdown($server_socket); # Even if we got warnings here, we should not fail this # particular test, as the warnings may be caused by an earlier @@ -3843,7 +4030,8 @@ sub run_testcase ($$) { # valuable debugging information even if there is no test failure recorded. sub _preserve_error_log_names { my ($mysqld)= @_; - my $error_log_file= $mysqld->value('#log-error'); + my $error_log_file= $mysqld->if_exist('#log-error'); + return unless $error_log_file and -r $error_log_file; my $error_log_dir= dirname($error_log_file); my $save_name= $error_log_dir ."/../". $mysqld->name() .".error.log"; return ($error_log_file, $save_name); @@ -3852,14 +4040,14 @@ sub _preserve_error_log_names { sub preserve_error_log { my ($mysqld)= @_; my ($error_log_file, $save_name)= _preserve_error_log_names($mysqld); - my $res= rename($error_log_file, $save_name); + rename($error_log_file, $save_name) if $save_name; # Ignore any errors, as it's just a best-effort to keep the log if possible. } sub restore_error_log { my ($mysqld)= @_; my ($error_log_file, $save_name)= _preserve_error_log_names($mysqld); - my $res= rename($save_name, $error_log_file); + rename($save_name, $error_log_file) if $save_name; } # Keep track of last position in mysqld error log where we scanned for @@ -3903,6 +4091,8 @@ sub pre_write_errorlog { sub extract_server_log ($$) { my ($error_log, $tname) = @_; + + return unless $error_log; # Open the servers .err log file and read all lines # belonging to current test into @lines @@ -3945,9 +4135,9 @@ sub get_log_from_proc ($$) { my ($proc, $name)= @_; my $srv_log= ""; - foreach my $mysqld (mysqlds()) { + foreach my $mysqld (all_servers()) { if ($mysqld->{proc} eq $proc) { - my @srv_lines= extract_server_log($mysqld->value('#log-error'), $name); + my @srv_lines= extract_server_log($mysqld->if_exist('#log-error'), $name); $srv_log= "\nServer log from this test:\n" . join ("", @srv_lines); last; } @@ -4026,15 +4216,18 @@ sub extract_warning_lines ($) { my @antipatterns = ( qr/error .*connecting to master/, + qr/Plugin 'ndbcluster' will be forced to shutdown/, qr/InnoDB: Error: in ALTER TABLE `test`.`t[12]`/, qr/InnoDB: Error: table `test`.`t[12]` does not exist in the InnoDB internal/, qr/Slave: Unknown table 't1' Error_code: 1051/, qr/Slave SQL:.*(Error_code: [[:digit:]]+|Query:.*)/, qr/slave SQL thread aborted/, - qr/unknown option '--loose-/, - qr/unknown variable 'loose-/, + qr/unknown option '--loose[-_]/, + qr/unknown variable 'loose[-_]/, qr/Now setting lower_case_table_names to [02]/, qr/Setting lower_case_table_names=2/, + qr/You have forced lower_case_table_names to 0/, + qr/Plugin 'ndbcluster' will be forced to shutdow/, qr/deprecated/, qr/Slave SQL thread retried transaction/, qr/Slave \(additional info\)/, @@ -4343,29 +4536,18 @@ sub clean_dir { sub clean_datadir { - mtr_verbose("Cleaning datadirs..."); if (started(all_servers()) != 0){ mtr_error("Trying to clean datadir before all servers stopped"); } - foreach my $cluster ( clusters() ) + for (all_servers()) { - my $cluster_dir= "$opt_vardir/".$cluster->{name}; - mtr_verbose(" - removing '$cluster_dir'"); - rmtree($cluster_dir); - - } - - foreach my $mysqld ( mysqlds() ) - { - my $mysqld_dir= dirname($mysqld->value('datadir')); - preserve_error_log($mysqld); - if (-d $mysqld_dir ) { - mtr_verbose(" - removing '$mysqld_dir'"); - rmtree($mysqld_dir); - } + preserve_error_log($_); # or at least, try to + my $dir= "$opt_vardir/".$_->{name}; + mtr_verbose(" - removing '$dir'"); + rmtree($dir); } # Remove all files in tmp and var/tmp @@ -4388,17 +4570,6 @@ sub save_datadir_after_failure($$) { } -sub remove_ndbfs_from_ndbd_datadir { - my ($ndbd_datadir)= @_; - # Remove the ndb_*_fs directory from ndbd.X/ dir - foreach my $ndbfs_dir ( glob("$ndbd_datadir/ndb_*_fs") ) - { - next unless -d $ndbfs_dir; # Skip if not a directory - rmtree($ndbfs_dir); - } -} - - sub after_failure ($) { my ($tinfo)= @_; @@ -4415,31 +4586,18 @@ sub after_failure ($) { mkpath($save_dir) if ! -d $save_dir; - # Save the used my.cnf file - copy($path_config_file, $save_dir); + # Save the used config files + my %config_files = config_files($tinfo); + while (my ($file, $generate) = each %config_files) { + copy("$opt_vardir/$file", $save_dir); + } # Copy the tmp dir copytree("$opt_vardir/tmp/", "$save_dir/tmp/"); - if ( clusters() ) { - foreach my $cluster ( clusters() ) { - my $cluster_dir= "$opt_vardir/".$cluster->{name}; - - # Remove the fileystem of each ndbd - foreach my $ndbd ( in_cluster($cluster, ndbds()) ) - { - my $ndbd_datadir= $ndbd->value("DataDir"); - remove_ndbfs_from_ndbd_datadir($ndbd_datadir); - } - - save_datadir_after_failure($cluster_dir, $save_dir); - } - } - else { - foreach my $mysqld ( mysqlds() ) { - my $data_dir= $mysqld->value('datadir'); - save_datadir_after_failure(dirname($data_dir), $save_dir); - } + foreach (all_servers()) { + my $dir= "$opt_vardir/".$_->{name}; + save_datadir_after_failure($dir, $save_dir); } } @@ -4577,8 +4735,8 @@ sub mysqld_arguments ($$$) { mtr_add_arg($args, "%s--log-output=table,file"); } - # Check if "extra_opt" contains skip-log-bin - my $skip_binlog= grep(/^(--|--loose-)skip-log-bin/, @$extra_opts); + # Check if "extra_opt" contains --log-bin + my $skip_binlog= not grep /^--(loose-)?log-bin/, @$extra_opts; # Indicate to mysqld it will be debugged in debugger if ( $glob_debugger ) @@ -4834,8 +4992,7 @@ sub server_need_restart { return 1; } - my $is_mysqld= grep ($server eq $_, mysqlds()); - if ($is_mysqld) + if ($server->name() =~ /^mysqld\./) { # Check that running process was started with same options @@ -4887,17 +5044,9 @@ sub servers_need_restart($) { -# -# Return list of specific servers -# - there is no servers in an empty config -# -sub _like { return $config ? $config->like($_[0]) : (); } -sub mysqlds { return _like('mysqld.'); } -sub ndbds { return _like('cluster_config.ndbd.');} -sub ndb_mgmds { return _like('cluster_config.ndb_mgmd.'); } -sub clusters { return _like('mysql_cluster.'); } -sub all_servers { return ( mysqlds(), ndb_mgmds(), ndbds() ); } +############################################ +############################################ # # Filter a list of servers and return only those that are part @@ -4951,28 +5100,10 @@ sub get_extra_opts { sub stop_servers($$) { my (@servers)= @_; - if ( join('|', @servers) eq join('|', all_servers()) ) - { - # All servers are going down, use some kind of order to - # avoid too many warnings in the log files - - mtr_report("Restarting all servers"); - - # mysqld processes - My::SafeProcess::shutdown( $opt_shutdown_timeout, started(mysqlds()) ); - - # cluster processes - My::SafeProcess::shutdown( $opt_shutdown_timeout, - started(ndbds(), ndb_mgmds()) ); - } - else - { - mtr_report("Restarting ", started(@servers)); + mtr_report("Restarting ", started(@servers)); - # Stop only some servers - My::SafeProcess::shutdown( $opt_shutdown_timeout, - started(@servers) ); - } + My::SafeProcess::shutdown($opt_shutdown_timeout, + started(@servers)); foreach my $server (@servers) { @@ -4999,145 +5130,14 @@ sub stop_servers($$) { sub start_servers($) { my ($tinfo)= @_; - # Start clusters - foreach my $cluster ( clusters() ) - { - ndbcluster_start($cluster); - } - - # Start mysqlds - foreach my $mysqld ( mysqlds() ) - { - if ( $mysqld->{proc} ) - { - # Already started - - # Write start of testcase to log file - mark_log($mysqld->value('#log-error'), $tinfo); - - next; - } - - my $datadir= $mysqld->value('datadir'); - if ($opt_start_dirty) - { - # Don't delete anything if starting dirty - ; - } - else - { - - my @options= ('log-bin', 'relay-log'); - foreach my $option_name ( @options ) { - next unless $mysqld->option($option_name); - - my $file_name= $mysqld->value($option_name); - next unless - defined $file_name and - -e $file_name; - - mtr_debug(" -removing '$file_name'"); - unlink($file_name) or die ("unable to remove file '$file_name'"); - } - - if (-d $datadir ) { - preserve_error_log($mysqld); - mtr_verbose(" - removing '$datadir'"); - rmtree($datadir); - } - } - - my $mysqld_basedir= $mysqld->value('basedir'); - if ( $basedir eq $mysqld_basedir ) - { - if (! $opt_start_dirty) # If dirty, keep possibly grown system db - { - # Copy datadir from installed system db - for my $path ( "$opt_vardir", "$opt_vardir/..") { - my $install_db= "$path/install.db"; - copytree($install_db, $datadir) - if -d $install_db; - } - mtr_error("Failed to copy system db to '$datadir'") - unless -d $datadir; - } - } - else - { - mysql_install_db($mysqld); # For versional testing - - mtr_error("Failed to install system db to '$datadir'") - unless -d $datadir; - - } - restore_error_log($mysqld); - - # Create the servers tmpdir - my $tmpdir= $mysqld->value('tmpdir'); - mkpath($tmpdir) unless -d $tmpdir; - - # Write start of testcase to log file - mark_log($mysqld->value('#log-error'), $tinfo); - - # Run <tname>-master.sh - if ($mysqld->option('#!run-master-sh') and - run_sh_script($tinfo->{master_sh}) ) - { - $tinfo->{'comment'}= "Failed to execute '$tinfo->{master_sh}'"; - return 1; - } - - # Run <tname>-slave.sh - if ($mysqld->option('#!run-slave-sh') and - run_sh_script($tinfo->{slave_sh})) - { - $tinfo->{'comment'}= "Failed to execute '$tinfo->{slave_sh}'"; - return 1; - } - - if (!$opt_embedded_server) - { - my $extra_opts= get_extra_opts($mysqld, $tinfo); - mysqld_start($mysqld,$extra_opts); - - # Save this test case information, so next can examine it - $mysqld->{'started_tinfo'}= $tinfo; - } - - } - - # Wait for clusters to start - foreach my $cluster ( clusters() ) - { - if (ndbcluster_wait_started($cluster, "")) - { - # failed to start - $tinfo->{'comment'}= "Start of '".$cluster->name()."' cluster failed"; - return 1; - } + for (all_servers()) { + $_->{START}->($_, $tinfo) if $_->{START}; } - # Wait for mysqlds to start - foreach my $mysqld ( mysqlds() ) - { - next if !started($mysqld); - - if (sleep_until_file_created($mysqld->value('pid-file'), - $opt_start_timeout, - $mysqld->{'proc'}) == 0) { - $tinfo->{comment}= - "Failed to start ".$mysqld->name(); - - my $logfile= $mysqld->value('#log-error'); - if ( defined $logfile and -f $logfile ) - { - my @srv_lines= extract_server_log($logfile, $tinfo->{name}); - $tinfo->{logfile}= "Server log is:\n" . join ("", @srv_lines); - } - else - { - $tinfo->{logfile}= "Could not open server logfile: '$logfile'"; - } + for (all_servers()) { + next unless $_->{WAIT} and started($_); + if ($_->{WAIT}->($_)) { + $tinfo->{comment}= "Failed to start ".$_->name(); return 1; } } @@ -5835,3 +5835,25 @@ sub list_options ($) { exit(1); } + +sub time_format($) { + sprintf '%d:%02d:%02d', $_[0]/3600, ($_[0]/60)%60, $_[0]%60; +} + +my $num_tests; + +sub xterm_stat { + if (-t STDOUT and $ENV{TERM} =~ /xterm/) { + my ($left) = @_; + + # 2.5 -> best by test + $num_tests = $left + 2.5 unless $num_tests; + + my $done = $num_tests - $left; + my $spent = time - $^T; + + printf "\e];mtr: spent %s on %d tests. %s (%d tests) left\a", + time_format($spent), $done, + time_format($spent/$done * $left), $left; + } +} diff --git a/mysql-test/r/exampledb.result b/mysql-test/r/exampledb.result deleted file mode 100644 index 6eea24e2e1f..00000000000 --- a/mysql-test/r/exampledb.result +++ /dev/null @@ -1,8 +0,0 @@ -drop database if exists events_test; -drop database if exists events_test2; -drop table if exists t1; -CREATE TABLE t1 ( -Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, -Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL -) ENGINE=example; -drop table t1; diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 645dd460735..deda00364aa 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1809,5 +1809,22 @@ SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a; MAX(t2.a) 2 DROP TABLE t1, t2; +CREATE TABLE t1 (a int(11) NOT NULL); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 ( +key_col int(11) NOT NULL, +KEY (key_col) +); +INSERT INTO t2 VALUES (1),(2); +select min(t2.key_col) from t1,t2 where t1.a=1; +min(t2.key_col) +1 +select min(t2.key_col) from t1,t2 where t1.a > 1000; +min(t2.key_col) +NULL +select min(t2.key_col)+1 from t1,t2 where t1.a> 1000; +min(t2.key_col)+1 +NULL +drop table t1,t2; # # End of 5.1 tests diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result index 482e0045840..153fbed9622 100644 --- a/mysql-test/r/subselect4.result +++ b/mysql-test/r/subselect4.result @@ -59,3 +59,26 @@ FROM t3 WHERE 1 = 0 GROUP BY 1; (SELECT 1 FROM t1,t2 WHERE t2.b > t3.b) DROP TABLE t1,t2,t3; End of 5.0 tests. +CREATE TABLE t1 (col_int_nokey int(11) NOT NULL, col_varchar_nokey varchar(1) NOT NULL) engine=myisam; +INSERT INTO t1 VALUES (2,'s'),(0,'v'),(2,'s'); +CREATE TABLE t2 ( +pk int(11) NOT NULL AUTO_INCREMENT, +`col_int_key` int(11) NOT NULL, +col_varchar_key varchar(1) NOT NULL, +PRIMARY KEY (pk), +KEY `col_int_key` (`col_int_key`), +KEY `col_varchar_key` (`col_varchar_key`) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (4,10,'g'), (5,20,'v'); +SELECT t1.col_int_nokey,(SELECT MIN( t2_a.col_int_key ) FROM t2 t2_a, t2 t2_b, t1 t1_a WHERE t1_a.col_varchar_nokey = t2_b.col_varchar_key and t1.col_int_nokey ) as sub FROM t1; +col_int_nokey sub +2 10 +0 NULL +2 10 +SELECT t1.col_int_nokey,(SELECT MIN( t2_a.col_int_key ) +1 FROM t2 t2_a, t2 t2_b, t1 t1_a WHERE t1_a.col_varchar_nokey = t2_b.col_varchar_key and t1.col_int_nokey ) as sub FROM t1; +col_int_nokey sub +2 11 +0 NULL +2 11 +DROP TABLE t1,t2; +End of 5.1 tests. diff --git a/mysql-test/r/warnings_engine_disabled.result b/mysql-test/r/warnings_engine_disabled.result index e5d35fdaa5f..2cc68eed653 100644 --- a/mysql-test/r/warnings_engine_disabled.result +++ b/mysql-test/r/warnings_engine_disabled.result @@ -1,15 +1,14 @@ -create table t1 (id int) engine=NDB; +create table t1 (id int) engine=InnoDB; Warnings: -Warning 1286 Unknown table engine 'NDB' +Warning 1286 Unknown table engine 'InnoDB' Warning 1266 Using storage engine MyISAM for table 't1' -alter table t1 engine=NDB; +alter table t1 engine=InnoDB; Warnings: -Warning 1286 Unknown table engine 'NDB' +Warning 1286 Unknown table engine 'InnoDB' drop table t1; -SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ndbcluster'; +SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='InnoDB'; ENGINE SUPPORT -ndbcluster NO -SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE -PLUGIN_NAME='ndbcluster'; +InnoDB NO +SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='InnoDB'; PLUGIN_NAME PLUGIN_STATUS -ndbcluster DISABLED +InnoDB DISABLED diff --git a/mysql-test/suite/binlog/t/binlog_base64_flag.test b/mysql-test/suite/binlog/t/binlog_base64_flag.test index 3f1e4e98bec..2964b493c5d 100644 --- a/mysql-test/suite/binlog/t/binlog_base64_flag.test +++ b/mysql-test/suite/binlog/t/binlog_base64_flag.test @@ -7,6 +7,7 @@ # BINLOG statement does not work in embedded mode. +source include/have_log_bin.inc; source include/not_embedded.inc; disable_warnings; diff --git a/mysql-test/suite/binlog/t/binlog_old_versions.test b/mysql-test/suite/binlog/t/binlog_old_versions.test index 0ccea406a82..32c27fe8f89 100644 --- a/mysql-test/suite/binlog/t/binlog_old_versions.test +++ b/mysql-test/suite/binlog/t/binlog_old_versions.test @@ -22,6 +22,7 @@ # Related bugs: BUG#27779, BUG#31581, BUG#31582, BUG#31583, BUG#32407 +source include/have_log_bin.inc; source include/not_embedded.inc; --disable_warnings diff --git a/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam-master.opt b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam-master.opt index e76299453d3..cb48f1aaf60 100644 --- a/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam-master.opt +++ b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=2 +--loose-innodb_lock_wait_timeout=2 diff --git a/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt index e76299453d3..cb48f1aaf60 100644 --- a/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt +++ b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=2 +--loose-innodb_lock_wait_timeout=2 diff --git a/mysql-test/suite/federated/federated_bug_32426.result b/mysql-test/suite/federated/federated_bug_32426.result new file mode 100644 index 00000000000..fbfa6dc3d52 --- /dev/null +++ b/mysql-test/suite/federated/federated_bug_32426.result @@ -0,0 +1,30 @@ +CREATE DATABASE federated; +CREATE DATABASE federated; +# +# Bug #32426: FEDERATED query returns corrupt results for ORDER BY +# on a TEXT column +# +CREATE TABLE federated.t1(a TEXT); +INSERT INTO federated.t1 VALUES('abc'), ('gh'), ('f'), ('ijk'), ('de'); +CREATE TABLE federated.t1(a TEXT) ENGINE=FEDERATED +CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; +SELECT * FROM federated.t1 ORDER BY A; +a +abc +de +f +gh +ijk +SELECT * FROM federated.t1 ORDER BY A DESC; +a +ijk +gh +f +de +abc +DROP TABLE federated.t1; +DROP TABLE federated.t1; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE IF EXISTS federated; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE IF EXISTS federated; diff --git a/mysql-test/suite/federated/federated_bug_32426.test b/mysql-test/suite/federated/federated_bug_32426.test new file mode 100644 index 00000000000..254dfaa610a --- /dev/null +++ b/mysql-test/suite/federated/federated_bug_32426.test @@ -0,0 +1,24 @@ +source federated.inc; + +--echo # +--echo # Bug #32426: FEDERATED query returns corrupt results for ORDER BY +--echo # on a TEXT column +--echo # +connection slave; +CREATE TABLE federated.t1(a TEXT); +INSERT INTO federated.t1 VALUES('abc'), ('gh'), ('f'), ('ijk'), ('de'); + +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE federated.t1(a TEXT) ENGINE=FEDERATED + CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; +SELECT * FROM federated.t1 ORDER BY A; +SELECT * FROM federated.t1 ORDER BY A DESC; +DROP TABLE federated.t1; + +connection slave; +DROP TABLE federated.t1; + +connection default; + +source federated_cleanup.inc; diff --git a/mysql-test/suite/federated/federated_innodb-slave.opt b/mysql-test/suite/federated/federated_innodb-slave.opt index 627becdbfb5..48457b17309 100644 --- a/mysql-test/suite/federated/federated_innodb-slave.opt +++ b/mysql-test/suite/federated/federated_innodb-slave.opt @@ -1 +1 @@ ---innodb +--loose-innodb diff --git a/mysql-test/suite/federated/federated_server.result b/mysql-test/suite/federated/federated_server.result index 753b9286287..05782c6ef81 100644 --- a/mysql-test/suite/federated/federated_server.result +++ b/mysql-test/suite/federated/federated_server.result @@ -213,7 +213,7 @@ id name alter server s1 options (database 'db_bogus'); flush tables; select * from federated.t1; -ERROR 42000: Got error: 1044 : Access denied for user 'test_fed'@'localhost' to database 'db_bogus' +ERROR 42000: Received error: 1044 : Access denied for user 'test_fed'@'localhost' to database 'db_bogus' drop server if exists 's1'; ERROR 42000: Access denied; you need the SUPER privilege for this operation create server 's1' foreign data wrapper 'mysql' options diff --git a/mysql-test/suite/federated/my.cnf b/mysql-test/suite/federated/my.cnf index 82600949712..7556abad300 100644 --- a/mysql-test/suite/federated/my.cnf +++ b/mysql-test/suite/federated/my.cnf @@ -3,9 +3,10 @@ [mysqld.1] log-bin= master-bin +loose-federated [mysqld.2] - +loose-federated [ENV] MASTER_MYPORT= @mysqld.1.port diff --git a/mysql-test/suite/funcs_1/t/is_columns_is.test b/mysql-test/suite/funcs_1/t/is_columns_is.test index 0ac687354a1..7e40eac0923 100644 --- a/mysql-test/suite/funcs_1/t/is_columns_is.test +++ b/mysql-test/suite/funcs_1/t/is_columns_is.test @@ -18,6 +18,7 @@ --source include/not_embedded.inc # This test depends on having the PBXT information_schema stuff. --source include/have_pbxt.inc +--source include/have_innodb.inc --source include/have_xtradb.inc let $my_where = WHERE table_schema = 'information_schema' diff --git a/mysql-test/suite/innodb/t/innodb-master.opt b/mysql-test/suite/innodb/t/innodb-master.opt index 4901efb416c..08a79432e47 100644 --- a/mysql-test/suite/innodb/t/innodb-master.opt +++ b/mysql-test/suite/innodb/t/innodb-master.opt @@ -1 +1 @@ ---binlog_cache_size=32768 --innodb_lock_wait_timeout=1 +--binlog_cache_size=32768 --loose-innodb_lock_wait_timeout=1 diff --git a/mysql-test/suite/innodb/t/innodb-semi-consistent-master.opt b/mysql-test/suite/innodb/t/innodb-semi-consistent-master.opt index e76299453d3..cb48f1aaf60 100644 --- a/mysql-test/suite/innodb/t/innodb-semi-consistent-master.opt +++ b/mysql-test/suite/innodb/t/innodb-semi-consistent-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=2 +--loose-innodb_lock_wait_timeout=2 diff --git a/mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero-master.opt b/mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero-master.opt index fad0da2ac2e..e27ee9b2c78 100644 --- a/mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero-master.opt +++ b/mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero-master.opt @@ -1 +1 @@ ---innodb-autoinc-lock-mode=0 +--loose-innodb-autoinc-lock-mode=0 diff --git a/mysql-test/suite/innodb/t/innodb_bug30919-master.opt b/mysql-test/suite/innodb/t/innodb_bug30919-master.opt index 8636d2d8734..58b254fe596 100644 --- a/mysql-test/suite/innodb/t/innodb_bug30919-master.opt +++ b/mysql-test/suite/innodb/t/innodb_bug30919-master.opt @@ -1 +1 @@ ---innodb --innodb_autoinc_lock_mode=0 +--loose-innodb --loose-innodb_autoinc_lock_mode=0 diff --git a/mysql-test/suite/innodb/t/innodb_bug39438-master.opt b/mysql-test/suite/innodb/t/innodb_bug39438-master.opt index 43fac202fd4..0746d13d1c0 100644 --- a/mysql-test/suite/innodb/t/innodb_bug39438-master.opt +++ b/mysql-test/suite/innodb/t/innodb_bug39438-master.opt @@ -1 +1 @@ ---innodb-file-per-table=1 +--loose-innodb-file-per-table=1 diff --git a/mysql-test/suite/innodb/t/innodb_bug52663-master.opt b/mysql-test/suite/innodb/t/innodb_bug52663-master.opt index 462f8fbe828..82dec8b25fd 100644 --- a/mysql-test/suite/innodb/t/innodb_bug52663-master.opt +++ b/mysql-test/suite/innodb/t/innodb_bug52663-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=1 +--loose-innodb_lock_wait_timeout=1 diff --git a/mysql-test/suite/innodb/t/innodb_bug53674-master.opt b/mysql-test/suite/innodb/t/innodb_bug53674-master.opt index f1cfd7ab6c7..1fe48c3a33a 100644 --- a/mysql-test/suite/innodb/t/innodb_bug53674-master.opt +++ b/mysql-test/suite/innodb/t/innodb_bug53674-master.opt @@ -1 +1 @@ ---log-bin --innodb-locks-unsafe-for-binlog --binlog-format=mixed +--loose-innodb-locks-unsafe-for-binlog --binlog-format=mixed diff --git a/mysql-test/suite/innodb/t/innodb_bug53674.test b/mysql-test/suite/innodb/t/innodb_bug53674.test index 47f67f109c3..c96c3403b36 100644 --- a/mysql-test/suite/innodb/t/innodb_bug53674.test +++ b/mysql-test/suite/innodb/t/innodb_bug53674.test @@ -1,4 +1,5 @@ -- source include/have_innodb.inc +-- source include/have_log_bin.inc create table bug53674(a int)engine=innodb; insert into bug53674 values (1),(2); diff --git a/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1-master.opt b/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1-master.opt index 462f8fbe828..82dec8b25fd 100644 --- a/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1-master.opt +++ b/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=1 +--loose-innodb_lock_wait_timeout=1 diff --git a/mysql-test/suite/innodb/t/innodb_misc1-master.opt b/mysql-test/suite/innodb/t/innodb_misc1-master.opt index 4901efb416c..08a79432e47 100644 --- a/mysql-test/suite/innodb/t/innodb_misc1-master.opt +++ b/mysql-test/suite/innodb/t/innodb_misc1-master.opt @@ -1 +1 @@ ---binlog_cache_size=32768 --innodb_lock_wait_timeout=1 +--binlog_cache_size=32768 --loose-innodb_lock_wait_timeout=1 diff --git a/mysql-test/suite/innodb/t/innodb_mysql-master.opt b/mysql-test/suite/innodb/t/innodb_mysql-master.opt index 205c733455d..5b4331aa7a6 100644 --- a/mysql-test/suite/innodb/t/innodb_mysql-master.opt +++ b/mysql-test/suite/innodb/t/innodb_mysql-master.opt @@ -1 +1 @@ ---innodb-lock-wait-timeout=2 +--loose-innodb-lock-wait-timeout=2 diff --git a/mysql-test/suite/innodb/t/innodb_mysql_rbk-master.opt b/mysql-test/suite/innodb/t/innodb_mysql_rbk-master.opt index 0e400f9c36b..0de618855c3 100644 --- a/mysql-test/suite/innodb/t/innodb_mysql_rbk-master.opt +++ b/mysql-test/suite/innodb/t/innodb_mysql_rbk-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=1 --innodb_rollback_on_timeout=1 +--loose-innodb_lock_wait_timeout=1 --loose-innodb_rollback_on_timeout=1 diff --git a/mysql-test/suite/innodb/t/innodb_timeout_rollback-master.opt b/mysql-test/suite/innodb/t/innodb_timeout_rollback-master.opt index 50921bb4df0..a451be2eef0 100644 --- a/mysql-test/suite/innodb/t/innodb_timeout_rollback-master.opt +++ b/mysql-test/suite/innodb/t/innodb_timeout_rollback-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=2 --innodb_rollback_on_timeout +--loose-innodb_lock_wait_timeout=2 --loose-innodb_rollback_on_timeout diff --git a/mysql-test/suite/innodb_plugin/combinations b/mysql-test/suite/innodb_plugin/combinations new file mode 100644 index 00000000000..b18db5f876e --- /dev/null +++ b/mysql-test/suite/innodb_plugin/combinations @@ -0,0 +1,12 @@ +[innodb_plugin] +ignore-builtin-innodb +plugin-load=$HA_INNODB_PLUGIN_SO +innodb + +[xtradb_plugin] +ignore-builtin-innodb +plugin-load=$HA_XTRADB_SO +innodb + +[xtradb] +innodb diff --git a/mysql-test/suite/innodb_plugin/suite.pm b/mysql-test/suite/innodb_plugin/suite.pm new file mode 100644 index 00000000000..2a146b8a52f --- /dev/null +++ b/mysql-test/suite/innodb_plugin/suite.pm @@ -0,0 +1,19 @@ +package My::Suite::InnoDB_plugin; + +@ISA = qw(My::Suite); + +############# initialization ###################### +my @combinations; + +push @combinations, 'innodb_plugin' if $ENV{HA_INNODB_PLUGIN_SO}; +push @combinations, 'xtradb_plugin' if $ENV{HA_XTRADB_SO}; +push @combinations, 'xtradb' if $::mysqld_variables{'innodb'} eq "ON"; + +return "Neither innodb_plugin nor xtradb are available" unless @combinations; + +$ENV{INNODB_PLUGIN_COMBINATIONS}=join ':', @combinations + unless $ENV{INNODB_PLUGIN_COMBINATIONS}; + +############# return an object ###################### +bless { }; + diff --git a/mysql-test/suite/innodb_plugin/t/innodb-consistent-master.opt b/mysql-test/suite/innodb_plugin/t/innodb-consistent-master.opt index e76299453d3..cb48f1aaf60 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb-consistent-master.opt +++ b/mysql-test/suite/innodb_plugin/t/innodb-consistent-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=2 +--loose-innodb_lock_wait_timeout=2 diff --git a/mysql-test/suite/innodb_plugin/t/innodb-master.opt b/mysql-test/suite/innodb_plugin/t/innodb-master.opt index 4901efb416c..08a79432e47 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb-master.opt +++ b/mysql-test/suite/innodb_plugin/t/innodb-master.opt @@ -1 +1 @@ ---binlog_cache_size=32768 --innodb_lock_wait_timeout=1 +--binlog_cache_size=32768 --loose-innodb_lock_wait_timeout=1 diff --git a/mysql-test/suite/innodb_plugin/t/innodb-semi-consistent-master.opt b/mysql-test/suite/innodb_plugin/t/innodb-semi-consistent-master.opt index e76299453d3..cb48f1aaf60 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb-semi-consistent-master.opt +++ b/mysql-test/suite/innodb_plugin/t/innodb-semi-consistent-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=2 +--loose-innodb_lock_wait_timeout=2 diff --git a/mysql-test/suite/innodb_plugin/t/innodb-use-sys-malloc-master.opt b/mysql-test/suite/innodb_plugin/t/innodb-use-sys-malloc-master.opt index acf3b8729ed..fc8582b5887 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb-use-sys-malloc-master.opt +++ b/mysql-test/suite/innodb_plugin/t/innodb-use-sys-malloc-master.opt @@ -1 +1 @@ ---innodb-use-sys-malloc=true +--loose-innodb-use-sys-malloc=true diff --git a/mysql-test/suite/innodb_plugin/t/innodb_autoinc_lock_mode_zero-master.opt b/mysql-test/suite/innodb_plugin/t/innodb_autoinc_lock_mode_zero-master.opt index fad0da2ac2e..e27ee9b2c78 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_autoinc_lock_mode_zero-master.opt +++ b/mysql-test/suite/innodb_plugin/t/innodb_autoinc_lock_mode_zero-master.opt @@ -1 +1 @@ ---innodb-autoinc-lock-mode=0 +--loose-innodb-autoinc-lock-mode=0 diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug30919-master.opt b/mysql-test/suite/innodb_plugin/t/innodb_bug30919-master.opt index 8636d2d8734..b21ee4fb85e 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_bug30919-master.opt +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug30919-master.opt @@ -1 +1 @@ ---innodb --innodb_autoinc_lock_mode=0 +--loose-innodb_autoinc_lock_mode=0 diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug39438-master.opt b/mysql-test/suite/innodb_plugin/t/innodb_bug39438-master.opt index 43fac202fd4..0746d13d1c0 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_bug39438-master.opt +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug39438-master.opt @@ -1 +1 @@ ---innodb-file-per-table=1 +--loose-innodb-file-per-table=1 diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug42101-nonzero-master.opt b/mysql-test/suite/innodb_plugin/t/innodb_bug42101-nonzero-master.opt index d71dbe17d5b..3e6a61f4511 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_bug42101-nonzero-master.opt +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug42101-nonzero-master.opt @@ -1 +1 @@ ---innodb_commit_concurrency=1 +--loose-innodb_commit_concurrency=1 diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug53674-master.opt b/mysql-test/suite/innodb_plugin/t/innodb_bug53674-master.opt index f1cfd7ab6c7..352b408dd3a 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_bug53674-master.opt +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug53674-master.opt @@ -1 +1 @@ ---log-bin --innodb-locks-unsafe-for-binlog --binlog-format=mixed +--log-bin=master-bin --loose-innodb-locks-unsafe-for-binlog --binlog-format=mixed diff --git a/mysql-test/suite/innodb_plugin/t/innodb_lock_wait_timeout_1-master.opt b/mysql-test/suite/innodb_plugin/t/innodb_lock_wait_timeout_1-master.opt index 462f8fbe828..82dec8b25fd 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_lock_wait_timeout_1-master.opt +++ b/mysql-test/suite/innodb_plugin/t/innodb_lock_wait_timeout_1-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=1 +--loose-innodb_lock_wait_timeout=1 diff --git a/mysql-test/suite/innodb_plugin/t/innodb_mysql-master.opt b/mysql-test/suite/innodb_plugin/t/innodb_mysql-master.opt index 205c733455d..5b4331aa7a6 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_mysql-master.opt +++ b/mysql-test/suite/innodb_plugin/t/innodb_mysql-master.opt @@ -1 +1 @@ ---innodb-lock-wait-timeout=2 +--loose-innodb-lock-wait-timeout=2 diff --git a/mysql-test/suite/innodb_plugin/t/innodb_mysql_rbk-master.opt b/mysql-test/suite/innodb_plugin/t/innodb_mysql_rbk-master.opt index 0e400f9c36b..0de618855c3 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_mysql_rbk-master.opt +++ b/mysql-test/suite/innodb_plugin/t/innodb_mysql_rbk-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=1 --innodb_rollback_on_timeout=1 +--loose-innodb_lock_wait_timeout=1 --loose-innodb_rollback_on_timeout=1 diff --git a/mysql-test/suite/innodb_plugin/t/innodb_timeout_rollback-master.opt b/mysql-test/suite/innodb_plugin/t/innodb_timeout_rollback-master.opt index 50921bb4df0..a451be2eef0 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_timeout_rollback-master.opt +++ b/mysql-test/suite/innodb_plugin/t/innodb_timeout_rollback-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=2 --innodb_rollback_on_timeout +--loose-innodb_lock_wait_timeout=2 --loose-innodb_rollback_on_timeout diff --git a/mysql-test/suite/ndb_team/t/rpl_ndb_mix_innodb-master.opt b/mysql-test/suite/ndb_team/t/rpl_ndb_mix_innodb-master.opt index 3596fc4d3bd..416f8692654 100644 --- a/mysql-test/suite/ndb_team/t/rpl_ndb_mix_innodb-master.opt +++ b/mysql-test/suite/ndb_team/t/rpl_ndb_mix_innodb-master.opt @@ -1 +1 @@ ---innodb --default-storage-engine=innodb +--loose-innodb --default-storage-engine=innodb diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt b/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt index 9854fda301d..c610ea42924 100644 --- a/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt +++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt @@ -1 +1 @@ ---innodb_file_per_table=1 +--loose-innodb_file_per_table=1 diff --git a/mysql-test/suite/parts/t/partition_special_innodb-master.opt b/mysql-test/suite/parts/t/partition_special_innodb-master.opt index e76299453d3..cb48f1aaf60 100644 --- a/mysql-test/suite/parts/t/partition_special_innodb-master.opt +++ b/mysql-test/suite/parts/t/partition_special_innodb-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=2 +--loose-innodb_lock_wait_timeout=2 diff --git a/mysql-test/suite/pbxt/my.cnf b/mysql-test/suite/pbxt/my.cnf index 46c9bf8da4a..93308e4a1f2 100644 --- a/mysql-test/suite/pbxt/my.cnf +++ b/mysql-test/suite/pbxt/my.cnf @@ -2,6 +2,7 @@ !include include/default_mysqld.cnf [mysqld.1] +pbxt default-storage-engine=pbxt [ENV] diff --git a/mysql-test/suite/pbxt/t/suite.opt b/mysql-test/suite/pbxt/t/suite.opt deleted file mode 100644 index 3036df38940..00000000000 --- a/mysql-test/suite/pbxt/t/suite.opt +++ /dev/null @@ -1 +0,0 @@ ---default-storage-engine=pbxt diff --git a/mysql-test/suite/percona/percona_innodb_doublewrite_file-master.opt b/mysql-test/suite/percona/percona_innodb_doublewrite_file-master.opt index 0f4d0c45410..54f9f550277 100644 --- a/mysql-test/suite/percona/percona_innodb_doublewrite_file-master.opt +++ b/mysql-test/suite/percona/percona_innodb_doublewrite_file-master.opt @@ -1 +1 @@ ---innodb_doublewrite_file=ib_doublewrite +--loose-innodb_doublewrite_file=ib_doublewrite diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt index 627becdbfb5..48457b17309 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt +++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt @@ -1 +1 @@ ---innodb +--loose-innodb diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt index 627becdbfb5..48457b17309 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt +++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt @@ -1 +1 @@ ---innodb +--loose-innodb diff --git a/mysql-test/suite/rpl/rpl_1slave_base.cnf b/mysql-test/suite/rpl/rpl_1slave_base.cnf index 23b7ded9a7d..8cdc3a1f6b0 100644 --- a/mysql-test/suite/rpl/rpl_1slave_base.cnf +++ b/mysql-test/suite/rpl/rpl_1slave_base.cnf @@ -8,8 +8,6 @@ log-bin= master-bin -loose-innodb - [mysqld.2] # Run the slave.sh script before starting this process #!run-slave-sh @@ -18,7 +16,6 @@ loose-innodb # starting the mysqld #!use-slave-opt -log-bin= slave-bin relay-log= slave-relay-bin init-rpl-role= slave diff --git a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback-master.opt b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback-master.opt index 9e6e2b7829a..a8de78ed6f5 100644 --- a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback-master.opt +++ b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback-master.opt @@ -1 +1 @@ ---innodb --binlog-ignore-db=db2 +--loose-innodb --binlog-ignore-db=db2 diff --git a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback-slave.opt b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback-slave.opt index b4abda5893f..264b17285a2 100644 --- a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback-slave.opt @@ -1 +1 @@ ---innodb --replicate-do-db=db1 +--loose-innodb --replicate-do-db=db1 diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf index 141aaa7788d..536551ec3dc 100644 --- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf +++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf @@ -2,19 +2,19 @@ [mysqld.1] log-slave-updates -innodb +loose-innodb [mysqld.2] log-slave-updates -innodb +loose-innodb [mysqld.3] log-slave-updates -innodb +loose-innodb [mysqld.4] log-slave-updates -innodb +loose-innodb [ENV] SLAVE_MYPORT1= @mysqld.3.port diff --git a/mysql-test/suite/rpl/t/rpl_concurrency_error-master.opt b/mysql-test/suite/rpl/t/rpl_concurrency_error-master.opt index a6ef074a120..3f82baff598 100644 --- a/mysql-test/suite/rpl/t/rpl_concurrency_error-master.opt +++ b/mysql-test/suite/rpl/t/rpl_concurrency_error-master.opt @@ -1 +1 @@ ---innodb-lock-wait-timeout=1 +--loose-innodb-lock-wait-timeout=1 diff --git a/mysql-test/suite/rpl/t/rpl_ddl-slave.opt b/mysql-test/suite/rpl/t/rpl_ddl-slave.opt new file mode 100644 index 00000000000..21356507809 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_ddl-slave.opt @@ -0,0 +1 @@ +--loose-skip-innodb diff --git a/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt index 3819e7c3f7b..f516b1b7003 100644 --- a/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=4 --slave-transaction-retries=2 --max-relay-log-size=4096 +--loose-innodb-lock-wait-timeout=4 --slave-transaction-retries=2 --max-relay-log-size=4096 diff --git a/mysql-test/suite/rpl/t/rpl_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_innodb-master.opt index 0eed7aaadad..e27ee9b2c78 100644 --- a/mysql-test/suite/rpl/t/rpl_innodb-master.opt +++ b/mysql-test/suite/rpl/t/rpl_innodb-master.opt @@ -1 +1 @@ ---innodb_autoinc_lock_mode=0 +--loose-innodb-autoinc-lock-mode=0 diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt index 0eed7aaadad..e27ee9b2c78 100644 --- a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt +++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt @@ -1 +1 @@ ---innodb_autoinc_lock_mode=0 +--loose-innodb-autoinc-lock-mode=0 diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt index 0eed7aaadad..e27ee9b2c78 100644 --- a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt @@ -1 +1 @@ ---innodb_autoinc_lock_mode=0 +--loose-innodb-autoinc-lock-mode=0 diff --git a/mysql-test/suite/rpl/t/rpl_start_stop_slave-slave.opt b/mysql-test/suite/rpl/t/rpl_start_stop_slave-slave.opt index 00ea161cd6e..c7cdc20fe18 100644 --- a/mysql-test/suite/rpl/t/rpl_start_stop_slave-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave-slave.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=60 +--loose-innodb-lock-wait-timeout=60 diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test index e296da01bad..442f18ca61d 100644 --- a/mysql-test/suite/rpl/t/rpl_trigger.test +++ b/mysql-test/suite/rpl/t/rpl_trigger.test @@ -4,6 +4,11 @@ # TODO: Remove statement include once 12574 is patched --source include/have_binlog_format_mixed_or_statement.inc --source include/master-slave.inc +--source include/have_innodb.inc +connection slave; +--source include/have_innodb.inc +connection master; + CALL mtr.add_suppression("Statement may not be safe to log in statement format."); @@ -506,11 +511,9 @@ sync_slave_with_master; connection master; source include/master-slave-reset.inc; -source include/have_innodb.inc; connection slave; -source include/have_innodb.inc; - connection master; + create table t1 ( f int ) engine = innodb; create table log ( r int ) engine = myisam; create trigger tr diff --git a/mysql-test/suite/rpl/t/rpl_typeconv-slave.opt b/mysql-test/suite/rpl/t/rpl_typeconv-slave.opt index 73ca7001985..48457b17309 100644 --- a/mysql-test/suite/rpl/t/rpl_typeconv-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_typeconv-slave.opt @@ -1 +1 @@ ---innodb
\ No newline at end of file +--loose-innodb diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt index 0d3f1619f1e..4dda0e45a63 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt @@ -1 +1 @@ ---innodb --default-storage-engine=innodb --ndbcluster=0 +--loose-innodb --default-storage-engine=innodb --ndbcluster=0 diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt index dff423702b4..7dc78d6f05b 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt @@ -1 +1 @@ ---innodb --loose-ndbcluster=OFF --log-slave-updates=0 +--loose-innodb --loose-ndbcluster=OFF --log-slave-updates=0 diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf index b1b010ef0f3..64f69427643 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf @@ -2,15 +2,12 @@ [mysqld.1.1] server-id= 1 -log-bin [mysqld.2.1] server-id= 1 -log-bin [mysqld.1.slave] server-id= 2 -log-bin skip-slave-start [mysqld.2.slave] @@ -21,7 +18,6 @@ master-password= @mysqld.2.1.#password master-user= @mysqld.2.1.#user master-connect-retry= 1 init-rpl-role= slave -log-bin skip-slave-start ndb_connectstring= @mysql_cluster.slave.ndb_connectstring diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt index 627becdbfb5..48457b17309 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt @@ -1 +1 @@ ---innodb +--loose-innodb diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt index 627becdbfb5..48457b17309 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt @@ -1 +1 @@ ---innodb +--loose-innodb diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-master.opt index 627becdbfb5..48457b17309 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-master.opt +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-master.opt @@ -1 +1 @@ ---innodb +--loose-innodb diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-slave.opt index 627becdbfb5..48457b17309 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-slave.opt +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-slave.opt @@ -1 +1 @@ ---innodb +--loose-innodb diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-master.opt index b74354b22e1..0f4722c3fbd 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-master.opt +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-master.opt @@ -1 +1 @@ ---innodb --ndbcluster +--loose-innodb --ndbcluster diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-slave.opt index bbb86b2991b..a8829991a6d 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-slave.opt +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-slave.opt @@ -1 +1 @@ ---innodb --ndbcluster --replicate-ignore-table=mysql.ndb_apply_status +--loose-innodb --ndbcluster --replicate-ignore-table=mysql.ndb_apply_status diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt index 3596fc4d3bd..416f8692654 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt @@ -1 +1 @@ ---innodb --default-storage-engine=innodb +--loose-innodb --default-storage-engine=innodb diff --git a/mysql-test/suite/sys_vars/t/autocommit_func-master.opt b/mysql-test/suite/sys_vars/t/autocommit_func-master.opt index 627becdbfb5..48457b17309 100644 --- a/mysql-test/suite/sys_vars/t/autocommit_func-master.opt +++ b/mysql-test/suite/sys_vars/t/autocommit_func-master.opt @@ -1 +1 @@ ---innodb +--loose-innodb diff --git a/mysql-test/suite/sys_vars/t/character_set_filesystem_func-master.opt b/mysql-test/suite/sys_vars/t/character_set_filesystem_func-master.opt index 52a49182a53..303377e796b 100644 --- a/mysql-test/suite/sys_vars/t/character_set_filesystem_func-master.opt +++ b/mysql-test/suite/sys_vars/t/character_set_filesystem_func-master.opt @@ -1 +1 @@ ---secure-file-priv=$MYSQL_TEST_DIR --innodb +--secure-file-priv=$MYSQL_TEST_DIR --loose-innodb diff --git a/mysql-test/suite/sys_vars/t/identity_func-master.opt b/mysql-test/suite/sys_vars/t/identity_func-master.opt index 66f581b56d0..03f5ae2d108 100644 --- a/mysql-test/suite/sys_vars/t/identity_func-master.opt +++ b/mysql-test/suite/sys_vars/t/identity_func-master.opt @@ -1,2 +1,2 @@ ---innodb +--loose-innodb diff --git a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func-master.opt b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func-master.opt index ab9fcb75678..f0b6727d6d8 100644 --- a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func-master.opt +++ b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func-master.opt @@ -1,2 +1,2 @@ ---innodb-autoinc-lock-mode=1 +--loose-innodb-autoinc-lock-mode=1 diff --git a/mysql-test/suite/sys_vars/t/last_insert_id_func-master.opt b/mysql-test/suite/sys_vars/t/last_insert_id_func-master.opt index 66f581b56d0..03f5ae2d108 100644 --- a/mysql-test/suite/sys_vars/t/last_insert_id_func-master.opt +++ b/mysql-test/suite/sys_vars/t/last_insert_id_func-master.opt @@ -1,2 +1,2 @@ ---innodb +--loose-innodb diff --git a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt index 6e00d7157d6..2cadd0c7b3f 100644 --- a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt +++ b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt @@ -1,2 +1,2 @@ --log-bin ---innodb +--loose-innodb diff --git a/mysql-test/suite/sys_vars/t/storage_engine_basic-master.opt b/mysql-test/suite/sys_vars/t/storage_engine_basic-master.opt index 627becdbfb5..48457b17309 100644 --- a/mysql-test/suite/sys_vars/t/storage_engine_basic-master.opt +++ b/mysql-test/suite/sys_vars/t/storage_engine_basic-master.opt @@ -1 +1 @@ ---innodb +--loose-innodb diff --git a/mysql-test/suite/sys_vars/t/tx_isolation_func-master.opt b/mysql-test/suite/sys_vars/t/tx_isolation_func-master.opt index c15943a7544..67166a46cd1 100644 --- a/mysql-test/suite/sys_vars/t/tx_isolation_func-master.opt +++ b/mysql-test/suite/sys_vars/t/tx_isolation_func-master.opt @@ -1,3 +1,3 @@ ---innodb ---innodb_lock_wait_timeout=2 +--loose-innodb +--loose-innodb_lock_wait_timeout=2 --binlog-format=row
\ No newline at end of file diff --git a/mysql-test/t/bug46760-master.opt b/mysql-test/t/bug46760-master.opt index f830d135149..2d7be7fb9b1 100644 --- a/mysql-test/t/bug46760-master.opt +++ b/mysql-test/t/bug46760-master.opt @@ -1,2 +1,2 @@ ---innodb-lock-wait-timeout=2 ---innodb-file-per-table +--loose-innodb-lock-wait-timeout=2 +--loose-innodb-file-per-table diff --git a/mysql-test/t/concurrent_innodb_safelog-master.opt b/mysql-test/t/concurrent_innodb_safelog-master.opt index 462f8fbe828..82dec8b25fd 100644 --- a/mysql-test/t/concurrent_innodb_safelog-master.opt +++ b/mysql-test/t/concurrent_innodb_safelog-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=1 +--loose-innodb_lock_wait_timeout=1 diff --git a/mysql-test/t/concurrent_innodb_unsafelog-master.opt b/mysql-test/t/concurrent_innodb_unsafelog-master.opt index 210212a40bc..ea9c1b860e9 100644 --- a/mysql-test/t/concurrent_innodb_unsafelog-master.opt +++ b/mysql-test/t/concurrent_innodb_unsafelog-master.opt @@ -1,2 +1,2 @@ ---innodb_locks_unsafe_for_binlog ---innodb_lock_wait_timeout=1 +--loose-innodb_locks_unsafe_for_binlog +--loose-innodb_lock_wait_timeout=1 diff --git a/mysql-test/t/connect.cnf b/mysql-test/t/connect.cnf index 6c52a4b144d..caf51ee2085 100644 --- a/mysql-test/t/connect.cnf +++ b/mysql-test/t/connect.cnf @@ -5,4 +5,4 @@ extra-port= @mysqld.1.#extra-port extra-max-connections=1 [ENV] -MASTER_EXTRA_PORT= @mysqld.1.extra-port +MASTER_EXTRA_PORT= @mysqld.1.#extra-port diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index cede26f555a..1de9d1c9847 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -14,3 +14,4 @@ query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails spo partition_innodb_plugin : Bug#53307 2010-04-30 VasilDimov valgrind warnings main.mysqlhotcopy_myisam : bug#54129 2010-06-04 Horst main.mysqlhotcopy_archive: bug#54129 2010-06-04 Horst +main.events_time_zone : Test is not predictable as it depends on precise timing. diff --git a/mysql-test/t/exampledb.test b/mysql-test/t/exampledb.test deleted file mode 100644 index fbb2a18f344..00000000000 --- a/mysql-test/t/exampledb.test +++ /dev/null @@ -1,22 +0,0 @@ -# -# Simple test for the example storage engine -# Taken fromm the select test -# --- source include/have_exampledb.inc - ---disable_warnings -# Clean up if event's test fails -drop database if exists events_test; -drop database if exists events_test2; - -drop table if exists t1; ---enable_warnings - -CREATE TABLE t1 ( - Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, - Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL -) ENGINE=example; - -drop table t1; - -# End of 4.1 tests diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index c5b27ee1a62..c640a58d597 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1219,6 +1219,23 @@ EXPLAIN SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a; SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a; DROP TABLE t1, t2; +# +# min() returns wrong value when used in expression when there is no matching +# rows +# + +CREATE TABLE t1 (a int(11) NOT NULL); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 ( + key_col int(11) NOT NULL, + KEY (key_col) +); +INSERT INTO t2 VALUES (1),(2); + +select min(t2.key_col) from t1,t2 where t1.a=1; +select min(t2.key_col) from t1,t2 where t1.a > 1000; +select min(t2.key_col)+1 from t1,t2 where t1.a> 1000; +drop table t1,t2; --echo # diff --git a/mysql-test/t/partition_innodb-master.opt b/mysql-test/t/partition_innodb-master.opt index 462f8fbe828..82dec8b25fd 100644 --- a/mysql-test/t/partition_innodb-master.opt +++ b/mysql-test/t/partition_innodb-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=1 +--loose-innodb_lock_wait_timeout=1 diff --git a/mysql-test/t/partition_innodb_semi_consistent-master.opt b/mysql-test/t/partition_innodb_semi_consistent-master.opt index e76299453d3..cb48f1aaf60 100644 --- a/mysql-test/t/partition_innodb_semi_consistent-master.opt +++ b/mysql-test/t/partition_innodb_semi_consistent-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=2 +--loose-innodb_lock_wait_timeout=2 diff --git a/mysql-test/t/pool_of_threads.cnf b/mysql-test/t/pool_of_threads.cnf index b96953ad1c5..9ab0571df9f 100644 --- a/mysql-test/t/pool_of_threads.cnf +++ b/mysql-test/t/pool_of_threads.cnf @@ -11,4 +11,4 @@ extra-max-connections=1 connect-timeout= 2 [ENV] -MASTER_EXTRA_PORT= @mysqld.1.extra-port +MASTER_EXTRA_PORT= @mysqld.1.#extra-port diff --git a/mysql-test/t/sp_trans_log.test b/mysql-test/t/sp_trans_log.test index 5eccbf81fef..ed054a0ebc6 100644 --- a/mysql-test/t/sp_trans_log.test +++ b/mysql-test/t/sp_trans_log.test @@ -3,7 +3,7 @@ # part of sp_trans test that appeared to be sensitive to binlog format --source include/have_innodb.inc ---source include/have_binlog_format_mixed_or_row.inc +--source include/have_binlog_format_mixed.inc delimiter |; diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test index 440eca22828..c287091ab54 100644 --- a/mysql-test/t/subselect4.test +++ b/mysql-test/t/subselect4.test @@ -62,3 +62,29 @@ FROM t3 WHERE 1 = 0 GROUP BY 1; DROP TABLE t1,t2,t3; --echo End of 5.0 tests. + +# +# Fix for LP#612894 +# Some aggregate functions (such as MIN MAX) work incorrectly in subqueries +# after getting NULL value +# + +CREATE TABLE t1 (col_int_nokey int(11) NOT NULL, col_varchar_nokey varchar(1) NOT NULL) engine=myisam; +INSERT INTO t1 VALUES (2,'s'),(0,'v'),(2,'s'); +CREATE TABLE t2 ( + pk int(11) NOT NULL AUTO_INCREMENT, + `col_int_key` int(11) NOT NULL, + col_varchar_key varchar(1) NOT NULL, + PRIMARY KEY (pk), + KEY `col_int_key` (`col_int_key`), + KEY `col_varchar_key` (`col_varchar_key`) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (4,10,'g'), (5,20,'v'); + +SELECT t1.col_int_nokey,(SELECT MIN( t2_a.col_int_key ) FROM t2 t2_a, t2 t2_b, t1 t1_a WHERE t1_a.col_varchar_nokey = t2_b.col_varchar_key and t1.col_int_nokey ) as sub FROM t1; + +SELECT t1.col_int_nokey,(SELECT MIN( t2_a.col_int_key ) +1 FROM t2 t2_a, t2 t2_b, t1 t1_a WHERE t1_a.col_varchar_nokey = t2_b.col_varchar_key and t1.col_int_nokey ) as sub FROM t1; + +DROP TABLE t1,t2; + +--echo End of 5.1 tests. diff --git a/mysql-test/t/unsafe_binlog_innodb-master.opt b/mysql-test/t/unsafe_binlog_innodb-master.opt index 9581c225d6d..d5ecd2ed9a5 100644 --- a/mysql-test/t/unsafe_binlog_innodb-master.opt +++ b/mysql-test/t/unsafe_binlog_innodb-master.opt @@ -1 +1 @@ ---innodb_locks_unsafe_for_binlog=true --innodb_lock_wait_timeout=1 +--loose-innodb_locks_unsafe_for_binlog=true --loose-innodb_lock_wait_timeout=1 diff --git a/mysql-test/t/warnings_engine_disabled.test b/mysql-test/t/warnings_engine_disabled.test index b8751a062b7..07a7e54c46c 100644 --- a/mysql-test/t/warnings_engine_disabled.test +++ b/mysql-test/t/warnings_engine_disabled.test @@ -2,23 +2,22 @@ # Only run this test with a compiled in but disabled # engine # -disable_query_log; ---require r/true.require -select support = 'NO' as `TRUE` from information_schema.engines where engine = 'ndbcluster'; -enable_query_log; +if (!`SELECT count(*) FROM information_schema.engines WHERE + support = 'NO' AND engine = 'innodb'`){ + skip Needs innodb engine; +} # # Test for handler type, will select MyISAM and print a warning -# about that - since NDB is disabled +# about that - since InnoDB is disabled # -create table t1 (id int) engine=NDB; -alter table t1 engine=NDB; +create table t1 (id int) engine=InnoDB; +alter table t1 engine=InnoDB; drop table t1; # # Bug#29263 disabled storage engines omitted in SHOW ENGINES # -SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ndbcluster'; -SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE -PLUGIN_NAME='ndbcluster'; +SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='InnoDB'; +SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='InnoDB'; |