Fix to consider ancient systems

This commit is contained in:
Ilia Ross
2025-06-29 22:28:30 +03:00
parent 1d24db1686
commit 522aeb5264
3 changed files with 16 additions and 2 deletions

View File

@@ -50,9 +50,10 @@ print &ui_table_row($text{'cnf_stor'},
'NDB', 'ARCHIVE', 'CSV',
'BLACKHOLE' ], 1, 0, 1));
my $ifpt_def_off = &get_innodb_file_per_table_default() ? 0 : 1;
$fpt = &find_value("innodb_file_per_table", $mems);
print &ui_table_row($text{'cnf_fpt'},
&ui_yesno_radio("fpt", $fpt // 1));
&ui_yesno_radio("fpt", $fpt // $ifpt_def_off));
$ilt = &find_value("innodb_lock_wait_timeout", $mems);
print &ui_table_row($text{'cnf_ilt'},

View File

@@ -1768,6 +1768,18 @@ return
$variant eq "mysql" && &compare_version_numbers($ver, "8.0") >= 0;
}
# get_innodb_file_per_table_default()
# Returns 1 if the InnoDB file-per-table option is disabled by default
sub get_innodb_file_per_table_default
{
my ($ver, $variant) = &get_remote_mysql_variant();
return
($variant eq 'mariadb' && &compare_version_numbers($ver, '10.1.0') < 0) ||
($variant eq 'mysql' && &compare_version_numbers($ver, '5.6.6') < 0)
? 1
: 0;
}
# get_plugin_sql(version, variant, plainpass, plugin)
# Get the right query for setting user password with plugin
sub get_plugin_sql

View File

@@ -53,8 +53,9 @@ else {
&save_directive($conf, $mysqld, "default-storage-engine",
$in{'stor'} ? [ $in{'stor'} ] : [ ]);
my $ifpt_def_off = &get_innodb_file_per_table_default();
&save_directive($conf, $mysqld, "innodb_file_per_table",
[ $in{'fpt'} ? undef : 0 ]);
[ $in{'fpt'} ? ($ifpt_def_off ? 1 : undef) : 0 ]);
if ($in{'ilt_def'}) {
&save_directive($conf, $mysqld, "innodb_lock_wait_timeout", [ ]);