summaryrefslogtreecommitdiff
path: root/mysql-test/lib
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/lib')
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_process.cc25
-rw-r--r--mysql-test/lib/mtr_cases.pm61
2 files changed, 75 insertions, 11 deletions
diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc
index dc7b7da28c7..50c433b9b39 100644
--- a/mysql-test/lib/My/SafeProcess/safe_process.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_process.cc
@@ -89,7 +89,7 @@ static void die(const char* fmt, ...)
}
-static void kill_child (void)
+static void kill_child(void)
{
int status= 0;
@@ -119,7 +119,7 @@ static void kill_child (void)
}
-static void handle_abort (int sig)
+extern "C" void handle_abort(int sig)
{
message("Got signal %d, child_pid: %d, sending ABRT", sig, child_pid);
@@ -128,8 +128,8 @@ static void handle_abort (int sig)
}
}
-
-static void handle_signal (int sig)
+
+extern "C" void handle_signal(int sig)
{
message("Got signal %d, child_pid: %d", sig, child_pid);
terminated= 1;
@@ -152,7 +152,7 @@ int main(int argc, char* const argv[] )
pid_t own_pid= getpid();
pid_t parent_pid= getppid();
bool nocore = false;
-
+
/* Install signal handlers */
signal(SIGTERM, handle_signal);
signal(SIGINT, handle_signal);
@@ -232,10 +232,11 @@ int main(int argc, char* const argv[] )
message("setrlimit failed, errno=%d", errno);
}
}
-
+
// Signal that child is ready
buf= 37;
- write(pfd[1], &buf, 1);
+ if ((write(pfd[1], &buf, 1)) < 1)
+ die("Failed to signal that child is ready");
// Close write end
close(pfd[1]);
@@ -246,8 +247,10 @@ int main(int argc, char* const argv[] )
close(pfd[1]); // Close unused write end
// Wait for child to signal it's ready
- read(pfd[0], &buf, 1);
- if(buf != 37)
+ if ((read(pfd[0], &buf, 1)) < 1)
+ die("Failed to read signal from child");
+
+ if (buf != 37)
die("Didn't get 37 from pipe");
close(pfd[0]); // Close read end
@@ -272,7 +275,7 @@ int main(int argc, char* const argv[] )
if (WIFEXITED(status))
{
// Process has exited, collect return status
- int ret_code= WEXITSTATUS(status);
+ ret_code= WEXITSTATUS(status);
message("Child exit: %d", ret_code);
// Exit with exit status of the child
exit(ret_code);
@@ -287,6 +290,6 @@ int main(int argc, char* const argv[] )
}
kill_child();
- exit(1);
+ return 1;
}
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index a7650d9056a..224babaaf32 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -480,6 +480,67 @@ sub collect_one_suite($)
#print_testcases(@cases);
}
}
+
+ # ----------------------------------------------------------------------
+ # Testing InnoDB plugin.
+ # ----------------------------------------------------------------------
+ my $lib_innodb_plugin=
+ mtr_file_exists(::vs_config_dirs('storage/innodb_plugin', 'ha_innodb_plugin.dll'),
+ "$::basedir/storage/innodb_plugin/.libs/ha_innodb_plugin.so",
+ "$::basedir/lib/mysql/plugin/ha_innodb_plugin.so",
+ "$::basedir/lib/mysql/plugin/ha_innodb_plugin.dll");
+ if ($::mysql_version_id >= 50100 && !(IS_WINDOWS && $::opt_embedded_server) &&
+ $lib_innodb_plugin)
+ {
+ my @new_cases;
+
+ foreach my $test (@cases)
+ {
+ next if ($test->{'skip'} || !$test->{'innodb_test'});
+ # Exceptions
+ next if ($test->{'name'} eq 'main.innodb'); # Failed with wrong errno (fk)
+ next if ($test->{'name'} eq 'main.index_merge_innodb'); # Explain diff
+ # innodb_file_per_table is rw with innodb_plugin
+ next if ($test->{'name'} eq 'sys_vars.innodb_file_per_table_basic');
+ # innodb_lock_wait_timeout is rw with innodb_plugin
+ next if ($test->{'name'} eq 'sys_vars.innodb_lock_wait_timeout_basic');
+ # Diff around innodb_thread_concurrency variable
+ next if ($test->{'name'} eq 'sys_vars.innodb_thread_concurrency_basic');
+ # Copy test options
+ my $new_test= My::Test->new();
+ while (my ($key, $value) = each(%$test))
+ {
+ if (ref $value eq "ARRAY")
+ {
+ push(@{$new_test->{$key}}, @$value);
+ }
+ else
+ {
+ $new_test->{$key}= $value;
+ }
+ }
+ my $plugin_filename= basename($lib_innodb_plugin);
+ push(@{$new_test->{master_opt}}, '--ignore-builtin-innodb');
+ push(@{$new_test->{master_opt}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
+ push(@{$new_test->{master_opt}}, "--plugin_load=innodb=$plugin_filename;innodb_locks=$plugin_filename");
+ push(@{$new_test->{slave_opt}}, '--ignore-builtin-innodb');
+ push(@{$new_test->{slave_opt}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
+ push(@{$new_test->{slave_opt}}, "--plugin_load=innodb=$plugin_filename;innodb_locks=$plugin_filename");
+ if ($new_test->{combination})
+ {
+ $new_test->{combination}.= ' + InnoDB plugin';
+ }
+ else
+ {
+ $new_test->{combination}= 'InnoDB plugin';
+ }
+ push(@new_cases, $new_test);
+ }
+ push(@cases, @new_cases);
+ }
+ # ----------------------------------------------------------------------
+ # End of testing InnoDB plugin.
+ # ----------------------------------------------------------------------
optimize_cases(\@cases);
#print_testcases(@cases);