mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge with 4.1
BitKeeper/etc/logging_ok: auto-union client/mysqltest.c: Auto merged configure.in: Auto merged include/my_global.h: Auto merged mysql-test/r/bdb.result: Auto merged mysql-test/r/connect.result: Auto merged mysql-test/r/multi_update.result: Auto merged mysql-test/r/show_check.result: Auto merged mysql-test/r/system_mysql_db.result: Auto merged mysql-test/t/multi_update.test: Auto merged sql/ha_berkeley.cc: Auto merged sql/ha_berkeley.h: Auto merged sql/ha_heap.h: Auto merged sql/ha_innodb.h: Auto merged sql/handler.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_db.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/opt_range.cc: Merge with 4.1 true -> TRUE and false -> FALSE
This commit is contained in:
@ -17,8 +17,24 @@ bindir=""
|
||||
|
||||
file=mysql_fix_privilege_tables.sql
|
||||
|
||||
# The following test is to make this script compatible with the 4.0 where
|
||||
# the single argument could be a password
|
||||
if test "$#" = 1
|
||||
then
|
||||
case "$1" in
|
||||
--*) ;;
|
||||
*) old_style_password="$1" ; shift ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# The following code is almost identical to the code in mysql_install_db.sh
|
||||
|
||||
case "$1" in
|
||||
--no-defaults|--defaults-file=*|--defaults-extra-file=*)
|
||||
defaults="$1"; shift
|
||||
;;
|
||||
esac
|
||||
|
||||
parse_arguments() {
|
||||
# We only need to pass arguments through to the server if we don't
|
||||
# handle them here. So, we collect unrecognized options (passed on
|
||||
@ -36,7 +52,7 @@ parse_arguments() {
|
||||
--user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||
--password=*) password=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||
--host=*) host=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||
--sql|--sql-only) sql_only=1;;
|
||||
--sql|--sql-only) sql_only=1 ;;
|
||||
--verbose) verbose=1 ;;
|
||||
--port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;;
|
||||
--socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;;
|
||||
@ -47,7 +63,7 @@ parse_arguments() {
|
||||
then
|
||||
# This sed command makes sure that any special chars are quoted,
|
||||
# so the arg gets passed exactly to the server.
|
||||
args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'`
|
||||
args="$args "`echo "$arg" | sed -e 's,\([^=a-zA-Z0-9_.-]\),\\\\\1,g'`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@ -94,11 +110,9 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
# The following test is to make this script compatible with the 4.0 where
|
||||
# the first argument was the password
|
||||
if test -z "$password"
|
||||
then
|
||||
password=`echo $args | sed -e 's/ *//g'`
|
||||
password=$old_style_password
|
||||
fi
|
||||
|
||||
cmd="$bindir/mysql -f --user=$user --host=$host"
|
||||
|
@ -8,6 +8,7 @@ use File::Path;
|
||||
use DBI;
|
||||
use Sys::Hostname;
|
||||
use File::Copy;
|
||||
use File::Temp;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
@ -626,7 +627,6 @@ sub copy_files {
|
||||
sub copy_index
|
||||
{
|
||||
my ($method, $files, $source, $target) = @_;
|
||||
my $tmpfile="$opt_tmpdir/mysqlhotcopy$$";
|
||||
|
||||
print "Copying indices for ".@$files." files...\n" unless $opt{quiet};
|
||||
foreach my $file (@$files)
|
||||
@ -652,23 +652,23 @@ sub copy_index
|
||||
}
|
||||
close OUTPUT || die "Error on close of $to: $!\n";
|
||||
}
|
||||
elsif ($opt{method} eq 'scp')
|
||||
elsif ($opt{method} =~ /^scp\b/)
|
||||
{
|
||||
my $tmp=$tmpfile;
|
||||
open(OUTPUT,">$tmp") || die "Can\'t create file $tmp: $!\n";
|
||||
if (syswrite(OUTPUT,$buff) != length($buff))
|
||||
my ($fh, $tmp)=tempfile('mysqlhotcopy-XXXXXX', DIR => $opt_tmpdir);
|
||||
die "Can\'t create/open file in $opt_tmpdir\n";
|
||||
if (syswrite($fh,$buff) != length($buff))
|
||||
{
|
||||
die "Error when writing data to $tmp: $!\n";
|
||||
}
|
||||
close OUTPUT || die "Error on close of $tmp: $!\n";
|
||||
safe_system("scp $tmp $to");
|
||||
close $fh || die "Error on close of $tmp: $!\n";
|
||||
safe_system("$opt{method} $tmp $to");
|
||||
unlink $tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
die "Can't use unsupported method '$opt{method}'\n";
|
||||
}
|
||||
}
|
||||
unlink "$tmpfile" if ($opt{method} eq 'scp');
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user