summaryrefslogtreecommitdiff
path: root/mysql-test/mysql-test-run.pl
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.blaudden>2007-02-26 14:25:59 +0100
committerunknown <msvensson@pilot.blaudden>2007-02-26 14:25:59 +0100
commitc431ab112dd1afb34a8e5029c638ccf0289a78cf (patch)
tree51cdb10a0d9eb61b6b3036f2ec898e83f357c172 /mysql-test/mysql-test-run.pl
parent1e98e7bfb241ec843bb289503c24bff34fbfe01f (diff)
parent5d4e0417ad5a4b7758f216f86ad91b97287eec29 (diff)
downloadmariadb-git-c431ab112dd1afb34a8e5029c638ccf0289a78cf.tar.gz
Merge pilot.blaudden:/home/msvensson/mysql/bug20166/my50-bug20166
into pilot.blaudden:/home/msvensson/mysql/bug20166/my51-bug20166 BitKeeper/etc/ignore: auto-union BitKeeper/deleted/.del-init_db.sql~a77d572c39d5a1f8: Auto merged BitKeeper/deleted/.del-mysql_create_system_tables.sh: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/create.result: Auto merged mysql-test/r/join.result: Auto merged mysql-test/r/sp-security.result: Auto merged mysql-test/t/create.test: Auto merged mysql-test/t/grant2.test: Auto merged mysql-test/t/init_connect.test: Auto merged mysql-test/t/ndb_basic.test: Auto merged mysql-test/t/ndb_index_ordered.test: Auto merged mysql-test/t/ndb_multi.test: Auto merged scripts/Makefile.am: Auto merged BitKeeper/deleted/.del-init_db.sql~af2dfeabaa348dd7: Auto merged mysql-test/r/mysql_upgrade.result: SCCS merged mysql-test/t/lock_multi.test: Use local mysql-test/t/rpl_temporary.test: Use local mysql-test/Makefile.am: Manual merge scripts/mysql_fix_privilege_tables.sh: Manual merge scripts/mysql_fix_privilege_tables.sql.in: Manual merge scripts/mysql_install_db.sh: Manual merge
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-xmysql-test/mysql-test-run.pl71
1 files changed, 37 insertions, 34 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 05789536330..f6a0e096796 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -300,6 +300,8 @@ our $path_ndb_examples_dir;
our $exe_ndb_example;
our $path_ndb_testrun_log;
+our $path_sql_dir;
+
our @data_dir_lst;
our $used_binlog_format;
@@ -1498,12 +1500,16 @@ sub executable_setup () {
$exe_mysql_fix_system_tables=
mtr_script_exists("$glob_basedir/scripts/mysql_fix_privilege_tables",
"$path_client_bindir/mysql_fix_privilege_tables");
+
}
+ # Look for SQL scripts directory
+ $path_sql_dir= mtr_path_exists("$glob_basedir/share",
+ "$glob_basedir/scripts");
+
# Look for mysql_fix_privilege_tables.sql script
$file_mysql_fix_privilege_tables=
- mtr_file_exists("$glob_basedir/scripts/mysql_fix_privilege_tables.sql",
- "$glob_basedir/share/mysql_fix_privilege_tables.sql");
+ mtr_file_exists("$path_sql_dir/mysql_fix_privilege_tables.sql");
if ( ! $opt_skip_ndbcluster and executable_setup_ndb())
{
@@ -1954,6 +1960,7 @@ sub environment_setup () {
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'}";
$ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
+
}
$ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables;
@@ -2871,38 +2878,11 @@ sub install_db ($$) {
my $type= shift;
my $data_dir= shift;
- my $init_db_sql= "lib/init_db.sql";
- my $init_db_sql_tmp= "/tmp/init_db.sql$$";
- my $args;
-
mtr_report("Installing \u$type Database");
- open(IN, $init_db_sql)
- or mtr_error("Can't open $init_db_sql: $!");
- open(OUT, ">", $init_db_sql_tmp)
- or mtr_error("Can't write to $init_db_sql_tmp: $!");
- while (<IN>)
- {
- chomp;
- s/\@HOSTNAME\@/$glob_hostname/;
- if ( /^\s*$/ )
- {
- print OUT "\n";
- }
- elsif (/;$/)
- {
- print OUT "$_\n";
- }
- else
- {
- print OUT "$_ ";
- }
- }
- close OUT;
- close IN;
+ my $args;
mtr_init_args(\$args);
-
mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--bootstrap");
mtr_add_arg($args, "--basedir=%s", $path_my_basedir);
@@ -2936,21 +2916,44 @@ sub install_db ($$) {
# ----------------------------------------------------------------------
$ENV{'MYSQLD_BOOTSTRAP_CMD'}= "$exe_mysqld_bootstrap " . join(" ", @$args);
+ # ----------------------------------------------------------------------
+ # Create the bootstrap.sql file
+ # ----------------------------------------------------------------------
+ my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql$$";
+
+ # Use the mysql database for system tables
+ mtr_tofile($bootstrap_sql_file, "use mysql");
+
+ # Add the offical mysql system tables and initial system data
+ # for a prodcuction system
+ mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables.sql",
+ $bootstrap_sql_file);
+
+ # 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
+ # or by downloading the timezone table package from our website
+ mtr_appendfile_to_file("$path_sql_dir/mysql_test_data_timezone.sql",
+ $bootstrap_sql_file);
+
+ # Fill help tables, just an empty file when running from bk repo
+ # but will be replaced by a real fill_help_tables.sql when
+ # building the source dist
+ mtr_appendfile_to_file("$path_sql_dir/fill_help_tables.sql",
+ $bootstrap_sql_file);
+
# Log bootstrap command
my $path_bootstrap_log= "$opt_vardir/log/bootstrap.log";
mtr_tofile($path_bootstrap_log,
"$exe_mysqld_bootstrap " . join(" ", @$args) . "\n");
- if ( mtr_run($exe_mysqld_bootstrap, $args, $init_db_sql_tmp,
+ if ( mtr_run($exe_mysqld_bootstrap, $args, $bootstrap_sql_file,
$path_bootstrap_log, $path_bootstrap_log,
"", { append_log_file => 1 }) != 0 )
{
- unlink($init_db_sql_tmp);
mtr_error("Error executing mysqld --bootstrap\n" .
- "Could not install $type test DBs");
+ "Could not install system database, see $path_bootstrap_log");
}
- unlink($init_db_sql_tmp);
}