mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 15:50:51 +03:00 
			
		
		
		
	Merge with 4.1
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
	 monty@mysql.com
					monty@mysql.com