Commit 05e7d35e authored by Elena Stepanova's avatar Elena Stepanova

MDEV-13583 Improvements for MTR rebootstrap introduced in MDEV-12042

- make re-bootstrap run with all extra options, not only InnoDB ones
- re-use previously created bootstrap.sql
- add --console
- fix debian patch to keep it applicable
parent 582545a3
...@@ -3509,14 +3509,16 @@ sub mysql_install_db { ...@@ -3509,14 +3509,16 @@ sub mysql_install_db {
mtr_add_arg($args, "--bootstrap"); mtr_add_arg($args, "--bootstrap");
mtr_add_arg($args, "--basedir=%s", $install_basedir); mtr_add_arg($args, "--basedir=%s", $install_basedir);
mtr_add_arg($args, "--datadir=%s", $install_datadir); mtr_add_arg($args, "--datadir=%s", $install_datadir);
mtr_add_arg($args, "--plugin-dir=%s", $plugindir);
mtr_add_arg($args, "--default-storage-engine=myisam"); mtr_add_arg($args, "--default-storage-engine=myisam");
mtr_add_arg($args, "--skip-plugin-$_") for @optional_plugins; mtr_add_arg($args, "--loose-skip-plugin-$_") for @optional_plugins;
# starting from 10.0 bootstrap scripts require InnoDB # starting from 10.0 bootstrap scripts require InnoDB
mtr_add_arg($args, "--loose-innodb"); mtr_add_arg($args, "--loose-innodb");
mtr_add_arg($args, "--loose-innodb-log-file-size=5M"); mtr_add_arg($args, "--loose-innodb-log-file-size=5M");
mtr_add_arg($args, "--disable-sync-frm"); mtr_add_arg($args, "--disable-sync-frm");
mtr_add_arg($args, "--tmpdir=%s", "$opt_vardir/tmp/"); mtr_add_arg($args, "--tmpdir=%s", "$opt_vardir/tmp/");
mtr_add_arg($args, "--core-file"); mtr_add_arg($args, "--core-file");
mtr_add_arg($args, "--console");
if ( $opt_debug ) if ( $opt_debug )
{ {
...@@ -3535,13 +3537,6 @@ sub mysql_install_db { ...@@ -3535,13 +3537,6 @@ sub mysql_install_db {
mtr_add_arg($args, $extra_opt); mtr_add_arg($args, $extra_opt);
} }
} }
# InnoDB options can come not only from the command line, but also
# from option files or combinations
foreach my $extra_opt ( @$extra_opts ) {
if ($extra_opt =~ /--innodb/) {
mtr_add_arg($args, $extra_opt);
}
}
# If DISABLE_GRANT_OPTIONS is defined when the server is compiled (e.g., # If DISABLE_GRANT_OPTIONS is defined when the server is compiled (e.g.,
# configure --disable-grant-options), mysqld will not recognize the # configure --disable-grant-options), mysqld will not recognize the
...@@ -3556,13 +3551,22 @@ sub mysql_install_db { ...@@ -3556,13 +3551,22 @@ sub mysql_install_db {
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
$ENV{'MYSQLD_BOOTSTRAP_CMD'}= "$exe_mysqld_bootstrap " . join(" ", @$args); $ENV{'MYSQLD_BOOTSTRAP_CMD'}= "$exe_mysqld_bootstrap " . join(" ", @$args);
# Extra options can come not only from the command line, but also
# from option files or combinations. We want them on a command line
# that is executed now, because otherwise the datadir might be
# incompatible with the test settings, but not on the general
# $MYSQLD_BOOTSTRAP_CMD line
foreach my $extra_opt ( @$extra_opts ) {
mtr_add_arg($args, $extra_opt);
}
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Create the bootstrap.sql file # Create the bootstrap.sql file
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql"; my $bootstrap_sql_file= "$opt_vardir/log/bootstrap.sql";
if (! -e $bootstrap_sql_file)
{
if ($opt_boot_gdb) { if ($opt_boot_gdb) {
gdb_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), gdb_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(),
$bootstrap_sql_file); $bootstrap_sql_file);
...@@ -3647,6 +3651,7 @@ sub mysql_install_db { ...@@ -3647,6 +3651,7 @@ sub mysql_install_db {
# Add procedures for checking server is restored after testcase # Add procedures for checking server is restored after testcase
mtr_tofile($bootstrap_sql_file, mtr_tofile($bootstrap_sql_file,
sql_to_bootstrap(mtr_grab_file("include/mtr_check.sql"))); sql_to_bootstrap(mtr_grab_file("include/mtr_check.sql")));
}
# Log bootstrap command # Log bootstrap command
my $path_bootstrap_log= "$opt_vardir/log/bootstrap.log"; my $path_bootstrap_log= "$opt_vardir/log/bootstrap.log";
......
...@@ -1083,7 +1083,7 @@ character-sets-dir MYSQL_CHARSETSDIR/ ...@@ -1083,7 +1083,7 @@ character-sets-dir MYSQL_CHARSETSDIR/
chroot (No default value) chroot (No default value)
completion-type NO_CHAIN completion-type NO_CHAIN
concurrent-insert AUTO concurrent-insert AUTO
console FALSE console TRUE
date-format %Y-%m-%d date-format %Y-%m-%d
datetime-format %Y-%m-%d %H:%i:%s datetime-format %Y-%m-%d %H:%i:%s
deadlock-search-depth-long 15 deadlock-search-depth-long 15
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment