mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Add support for bootstrapping from init_db.sql, which is used in
early versions of 5.1 and 5.0 Fix usage instruction of defaults_extra_file
This commit is contained in:
@ -2020,6 +2020,9 @@ sub sql_to_bootstrap {
|
|||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Replace @HOSTNAME with localhost
|
||||||
|
$line=~ s/\'\@HOSTNAME\@\'/localhost/;
|
||||||
|
|
||||||
# Default, just add the line without newline
|
# Default, just add the line without newline
|
||||||
# but with a space as separator
|
# but with a space as separator
|
||||||
$result.= "$line ";
|
$result.= "$line ";
|
||||||
@ -2071,24 +2074,40 @@ sub mysql_install_db {
|
|||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql";
|
my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql";
|
||||||
|
|
||||||
# Use the mysql database for system tables
|
if (-f "$path_sql_dir/mysql_system_tables.sql")
|
||||||
mtr_tofile($bootstrap_sql_file, "use mysql\n");
|
{
|
||||||
|
# Use the mysql database for system tables
|
||||||
|
mtr_tofile($bootstrap_sql_file, "use mysql\n");
|
||||||
|
|
||||||
# Add the offical mysql system tables
|
# Add the offical mysql system tables
|
||||||
# for a production system
|
# for a production system
|
||||||
mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables.sql",
|
mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables.sql",
|
||||||
$bootstrap_sql_file);
|
$bootstrap_sql_file);
|
||||||
|
|
||||||
# Add the mysql system tables initial data
|
# Add the mysql system tables initial data
|
||||||
# for a production system
|
# for a production system
|
||||||
mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables_data.sql",
|
mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables_data.sql",
|
||||||
$bootstrap_sql_file);
|
$bootstrap_sql_file);
|
||||||
|
|
||||||
# Add test data for timezone - this is just a subset, on a real
|
# Add test data for timezone - this is just a subset, on a real
|
||||||
# system these tables will be populated either by mysql_tzinfo_to_sql
|
# system these tables will be populated either by mysql_tzinfo_to_sql
|
||||||
# or by downloading the timezone table package from our website
|
# or by downloading the timezone table package from our website
|
||||||
mtr_appendfile_to_file("$path_sql_dir/mysql_test_data_timezone.sql",
|
mtr_appendfile_to_file("$path_sql_dir/mysql_test_data_timezone.sql",
|
||||||
$bootstrap_sql_file);
|
$bootstrap_sql_file);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
# Install db from init_db.sql that exist in early 5.1 and 5.0
|
||||||
|
# versions of MySQL
|
||||||
|
my $init_file= "$basedir/mysql-test/lib/init_db.sql";
|
||||||
|
mtr_report(" - from '$init_file'");
|
||||||
|
my $text= mtr_grab_file($init_file) or
|
||||||
|
mtr_error("Can't open '$init_file': $!");
|
||||||
|
|
||||||
|
mtr_tofile($bootstrap_sql_file,
|
||||||
|
sql_to_bootstrap($text));
|
||||||
|
}
|
||||||
|
|
||||||
# Fill help tables, just an empty file when running from bk repo
|
# Fill help tables, just an empty file when running from bk repo
|
||||||
# but will be replaced by a real fill_help_tables.sql when
|
# but will be replaced by a real fill_help_tables.sql when
|
||||||
@ -3741,7 +3760,7 @@ Options to control what engine/variation to run
|
|||||||
|
|
||||||
config|defaults-file=<config template> Use fixed config template for all
|
config|defaults-file=<config template> Use fixed config template for all
|
||||||
tests
|
tests
|
||||||
extra_defaults_file=<config template> Extra config template to add to
|
defaults_extra_file=<config template> Extra config template to add to
|
||||||
all generated configs
|
all generated configs
|
||||||
|
|
||||||
Options to control directories to use
|
Options to control directories to use
|
||||||
|
Reference in New Issue
Block a user