Commit 216f9faf authored by unknown's avatar unknown

Merge neptunus.(none):/home/msvensson/mysql/work/my50-work

into  neptunus.(none):/home/msvensson/mysql/work/my51-work


BitKeeper/etc/ignore:
  auto-union
client/mysql.cc:
  Auto merged
mysql-test/lib/mtr_process.pl:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/func_misc.result:
  Auto merged
mysql-test/r/mysql.result:
  Auto merged
mysql-test/t/mysql.test:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
mysql-test/r/rpl_000015.result:
  Auto merged
mysql-test/t/rpl_000015.test:
  Auto merged
sql-common/my_time.c:
  Auto merged
sql/sql_parse.cc:
  Auto merged
parents 5ccc2801 bb4b8d38
......@@ -708,7 +708,7 @@ sub mtr_wait_blocking($) {
}
}
# Start "mysqladmin shutdown" for a specific mysqld
# Start "mysqladmin <command>" for a specific mysqld
sub mtr_mysqladmin_start($$$) {
my $srv= shift;
my $command= shift;
......@@ -738,9 +738,8 @@ sub mtr_mysqladmin_start($$$) {
# Shutdown time must be high as slave may be in reconnect
mtr_add_arg($args, "--shutdown_timeout=$adm_shutdown_tmo");
mtr_add_arg($args, "$command");
my $path_mysqladmin_log= "$::opt_vardir/log/mysqladmin.log";
my $pid= mtr_spawn($::exe_mysqladmin, $args,
"", $path_mysqladmin_log, $path_mysqladmin_log, "",
"", "", "", "",
{ append_log_file => 1 });
mtr_verbose("mtr_mysqladmin_start, pid: $pid");
return $pid;
......
......@@ -94,10 +94,14 @@ sub mtr_report_test_skipped ($) {
{
print "[ disabled ] $tinfo->{'comment'}\n";
}
else
elsif ( $tinfo->{'comment'} )
{
print "[ skipped ] $tinfo->{'comment'}\n";
}
else
{
print "[ skipped ]\n";
}
}
sub mtr_report_tests_not_skipped_though_disabled ($) {
......
......@@ -66,7 +66,6 @@ use IO::Socket::INET;
use Data::Dumper;
use strict;
use warnings;
use diagnostics;
select(STDOUT);
$| = 1; # Automatically flush STDOUT
......@@ -311,11 +310,12 @@ my $source_dist= 0;
sub main ();
sub initial_setup ();
sub command_line_setup ();
sub datadir_setup ();
sub datadir_list_setup ();
sub executable_setup ();
sub environment_setup ();
sub kill_running_servers ();
sub cleanup_stale_files ();
sub remove_stale_vardir ();
sub setup_vardir ();
sub check_ssl_support ($);
sub check_running_as_root();
sub check_ndbcluster_support ($);
......@@ -1201,6 +1201,7 @@ sub command_line_setup () {
# Setup master->[0] with the settings for the extern server
$master->[0]->{'path_sock'}= $opt_socket if $opt_socket;
mtr_report("Using extern server at '$master->[0]->{path_sock}'");
}
else
{
......@@ -1216,7 +1217,7 @@ sub command_line_setup () {
$path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";
}
sub datadir_setup () {
sub datadir_list_setup () {
# Make a list of all data_dirs
@data_dir_lst = (
......@@ -1676,6 +1677,7 @@ sub environment_setup () {
$ENV{'SLAVE_MYPORT1'}= $slave->[1]->{'port'};
$ENV{'SLAVE_MYPORT2'}= $slave->[2]->{'port'};
$ENV{'MYSQL_TCP_PORT'}= $mysqld_variables{'port'};
$ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'master-port'};
$ENV{'IM_PATH_SOCK'}= $instance_manager->{path_sock};
$ENV{'IM_USERNAME'}= $instance_manager->{admin_login};
......@@ -1975,29 +1977,24 @@ sub kill_running_servers () {
# This is different from terminating processes we have
# started from this run of the script, this is terminating
# leftovers from previous runs.
if ( ! -d $opt_vardir )
{
if ( -l $opt_vardir and ! -d readlink($opt_vardir) )
{
mtr_report("Removing $opt_vardir symlink without destination");
unlink($opt_vardir);
}
# The "var" dir does not exist already
# the processes that mtr_kill_leftovers start will write
# their log files to var/log so it should be created
mkpath("$opt_vardir/log");
}
mtr_kill_leftovers();
}
}
sub cleanup_stale_files () {
my $created_by_mem_file= "$glob_mysql_test_dir/var/created_by_mem";
#
# Remove var and any directories in var/ created by previous
# tests
#
sub remove_stale_vardir () {
mtr_report("Removing Stale Files");
# Safety!
mtr_error("No, don't remove the vardir when running with --extern")
if $opt_extern;
mtr_verbose("opt_vardir: $opt_vardir");
if ( $opt_vardir eq $default_vardir )
{
#
......@@ -2006,29 +2003,48 @@ sub cleanup_stale_files () {
if ( -l $opt_vardir)
{
# var is a symlink
if (-f $created_by_mem_file)
if ( $opt_mem and readlink($opt_vardir) eq $opt_mem )
{
# Remove the directory which the link points at
mtr_verbose("Removing " . readlink($opt_vardir));
rmtree(readlink($opt_vardir));
# Remove the entire "var" dir
rmtree("$opt_vardir/");
# Remove the "var" symlink
mtr_verbose("unlink($opt_vardir)");
unlink($opt_vardir);
}
elsif ( $opt_mem )
{
# Just remove the "var" symlink
mtr_report("WARNING: Removing '$opt_vardir' symlink it's wrong");
mtr_verbose("unlink($opt_vardir)");
unlink($opt_vardir);
}
else
{
# Some users creates a soft link in mysql-test/var to another area
# - allow it
# - allow it, but remove all files in it
mtr_report("WARNING: Using the 'mysql-test/var' symlink");
rmtree("$opt_vardir/log");
rmtree("$opt_vardir/ndbcluster-$opt_ndbcluster_port");
rmtree("$opt_vardir/run");
rmtree("$opt_vardir/tmp");
# Make sure the directory where it points exist
mtr_error("The destination for symlink $opt_vardir does not exist")
if ! -d readlink($opt_vardir);
my $dir= shift;
foreach my $bin ( glob("$opt_vardir/*") )
{
mtr_verbose("Removing bin $bin");
rmtree($bin);
}
}
}
else
{
# Remove the entire "var" dir
mtr_verbose("Removing $opt_vardir/");
rmtree("$opt_vardir/");
}
}
......@@ -2040,21 +2056,43 @@ sub cleanup_stale_files () {
# Remove the var/ dir in mysql-test dir if any
# this could be an old symlink that shouldn't be there
mtr_verbose("Removing $default_vardir");
rmtree($default_vardir);
# Remove the "var" dir
mtr_verbose("Removing $opt_vardir/");
rmtree("$opt_vardir/");
}
}
#
# Create var and the directories needed in var
#
sub setup_vardir() {
mtr_report("Creating Directories");
if ( $opt_mem )
if ( $opt_vardir eq $default_vardir )
{
# Runinng with var as a link to some "memory" location, normally tmpfs
rmtree($opt_mem);
#
# Running with "var" in mysql-test dir
#
if ( -l $opt_vardir )
{
# it's a symlink
# Make sure the directory where it points exist
mtr_error("The destination for symlink $opt_vardir does not exist")
if ! -d readlink($opt_vardir);
}
elsif ( $opt_mem )
{
# Runinng with "var" as a link to some "memory" location, normally tmpfs
mtr_verbose("Creating $opt_mem");
mkpath($opt_mem);
mtr_report("Creating symlink from $opt_vardir to $opt_mem");
mtr_report("Symlinking 'var' to '$opt_mem'");
symlink($opt_mem, $opt_vardir);
# Put a small file to recognize this dir was created by --mem
mtr_tofile($created_by_mem_file, $opt_mem);
}
}
mkpath("$opt_vardir/log");
......@@ -2062,10 +2100,9 @@ sub cleanup_stale_files () {
mkpath("$opt_vardir/tmp");
mkpath($opt_tmpdir) if $opt_tmpdir ne "$opt_vardir/tmp";
# Remove old and create new data dirs
# Create new data dirs
foreach my $data_dir (@data_dir_lst)
{
rmtree("$data_dir");
mkpath("$data_dir/mysql");
mkpath("$data_dir/test");
}
......@@ -2602,23 +2639,41 @@ sub run_suite () {
sub initialize_servers () {
datadir_setup();
datadir_list_setup();
if ( ! $opt_extern )
if ( $opt_extern )
{
# Running against an already started server, if the specified
# vardir does not already exist it should be created
if ( ! -d $opt_vardir )
{
mtr_report("Creating '$opt_vardir'");
setup_vardir();
}
else
{
mtr_report("No need to create '$opt_vardir' it already exists");
}
}
else
{
kill_running_servers();
if ( ! $opt_start_dirty )
{
cleanup_stale_files();
remove_stale_vardir();
setup_vardir();
mysql_install_db();
if ( $opt_force )
{
# Save a snapshot of the freshly installed db
# to make it possible to restore to a known point in time
save_installed_db();
}
}
check_running_as_root();
}
check_running_as_root();
}
sub mysql_install_db () {
......@@ -3487,6 +3542,12 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
}
}
if ( $mysql_version_id <= 50106 )
{
# Force mysqld to use log files up until 5.1.6
mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'});
}
}
if ( $type eq 'slave' )
......@@ -3504,8 +3565,6 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--log-slave-updates", $prefix);
}
mtr_add_arg($args, "%s--log=%s", $prefix,
$slave->[$idx]->{'path_mylog'});
mtr_add_arg($args, "%s--master-retry-count=10", $prefix);
mtr_add_arg($args, "%s--pid-file=%s", $prefix,
$slave->[$idx]->{'path_pid'});
......@@ -3566,6 +3625,13 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
}
}
if ( $mysql_version_id <= 50106 )
{
# Force mysqld to use log files up until 5.1.6
mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'});
}
} # end slave
if ( $opt_debug )
......@@ -3642,7 +3708,6 @@ sub mysqld_arguments ($$$$$) {
elsif ( $type eq 'master' )
{
mtr_add_arg($args, "%s--open-files-limit=1024", $prefix);
mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'});
}
return $args;
......@@ -4803,7 +4868,7 @@ Options that pass on options
Options to run test on running server
extern Use running server for tests FIXME DANGEROUS
extern Use running server for tests
ndb-connectstring=STR Use running cluster, and connect using STR
ndb-connectstring-slave=STR Use running slave cluster, and connect using STR
user=USER User for connection to extern server
......
......@@ -8,7 +8,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
change master to master_host='127.0.0.1';
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 test MASTER_PORT 7 4 # # No No 0 0 0 # None 0 No #
# 127.0.0.1 test DEFAULT_MASTER_PORT 7 4 # # No No 0 0 0 # None 0 No #
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT;
show slave status;
......
......@@ -18,7 +18,7 @@ show slave status;
change master to master_host='127.0.0.1';
# The following needs to be cleaned up when change master is fixed
--replace_result $MYSQL_TCP_PORT MASTER_PORT
--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
--replace_result $MASTER_MYPORT MASTER_PORT
......
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