MDEV-12042 Re-bootstrap the server if InnoDB options are incompatible
This commit is contained in:
parent
c2ef0bb6ce
commit
ab62b7538f
8
mysql-test/include/innodb_page_size.combinations
Normal file
8
mysql-test/include/innodb_page_size.combinations
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[16k]
|
||||||
|
innodb-page-size=16K
|
||||||
|
|
||||||
|
[8k]
|
||||||
|
innodb-page-size=8K
|
||||||
|
|
||||||
|
[4k]
|
||||||
|
innodb-page-size=4K
|
4
mysql-test/include/innodb_page_size.inc
Normal file
4
mysql-test/include/innodb_page_size.inc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# The goal of including this file is to enable innodb_page_size combinations
|
||||||
|
# (see include/innodb_page_size.combinations)
|
||||||
|
|
||||||
|
--source include/have_innodb.inc
|
@ -3217,10 +3217,20 @@ sub mysql_server_start($) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $mysqld_basedir= $mysqld->value('basedir');
|
my $mysqld_basedir= $mysqld->value('basedir');
|
||||||
|
my $extra_opts= get_extra_opts($mysqld, $tinfo);
|
||||||
|
|
||||||
if ( $basedir eq $mysqld_basedir )
|
if ( $basedir eq $mysqld_basedir )
|
||||||
{
|
{
|
||||||
if (! $opt_start_dirty) # If dirty, keep possibly grown system db
|
if (! $opt_start_dirty) # If dirty, keep possibly grown system db
|
||||||
{
|
{
|
||||||
|
# Some InnoDB options are incompatible with the default bootstrap.
|
||||||
|
# If they are used, re-bootstrap
|
||||||
|
if ( $extra_opts and
|
||||||
|
"@$extra_opts" =~ /--innodb[-_](?:page[-_]size|checksum[-_]algorithm|undo[-_]tablespaces|log[-_]group[-_]home[-_]dir|data[-_]home[-_]dir)/ )
|
||||||
|
{
|
||||||
|
mysql_install_db($mysqld, undef, $extra_opts);
|
||||||
|
}
|
||||||
|
else {
|
||||||
# Copy datadir from installed system db
|
# Copy datadir from installed system db
|
||||||
my $path= ($opt_parallel == 1) ? "$opt_vardir" : "$opt_vardir/..";
|
my $path= ($opt_parallel == 1) ? "$opt_vardir" : "$opt_vardir/..";
|
||||||
my $install_db= "$path/install.db";
|
my $install_db= "$path/install.db";
|
||||||
@ -3228,6 +3238,7 @@ sub mysql_server_start($) {
|
|||||||
mtr_error("Failed to copy system db to '$datadir'") unless -d $datadir;
|
mtr_error("Failed to copy system db to '$datadir'") unless -d $datadir;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mysql_install_db($mysqld); # For versional testing
|
mysql_install_db($mysqld); # For versional testing
|
||||||
@ -3264,7 +3275,6 @@ sub mysql_server_start($) {
|
|||||||
|
|
||||||
if (!$opt_embedded_server)
|
if (!$opt_embedded_server)
|
||||||
{
|
{
|
||||||
my $extra_opts= get_extra_opts($mysqld, $tinfo);
|
|
||||||
mysqld_start($mysqld,$extra_opts);
|
mysqld_start($mysqld,$extra_opts);
|
||||||
|
|
||||||
# Save this test case information, so next can examine it
|
# Save this test case information, so next can examine it
|
||||||
@ -3488,7 +3498,7 @@ sub default_mysqld {
|
|||||||
|
|
||||||
|
|
||||||
sub mysql_install_db {
|
sub mysql_install_db {
|
||||||
my ($mysqld, $datadir)= @_;
|
my ($mysqld, $datadir, $extra_opts)= @_;
|
||||||
|
|
||||||
my $install_datadir= $datadir || $mysqld->value('datadir');
|
my $install_datadir= $datadir || $mysqld->value('datadir');
|
||||||
my $install_basedir= $mysqld->value('basedir');
|
my $install_basedir= $mysqld->value('basedir');
|
||||||
@ -3529,6 +3539,13 @@ 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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user