summaryrefslogtreecommitdiff
path: root/scripts/mysqlhotcopy.sh
diff options
context:
space:
mode:
authorunknown <lenz@mysql.com>2004-07-15 21:18:31 +0200
committerunknown <lenz@mysql.com>2004-07-15 21:18:31 +0200
commit5793176bda664c43aab4ec6627515675a4e39ef0 (patch)
tree5e167a5ba151b7525191603ecfc5f4432e1df770 /scripts/mysqlhotcopy.sh
parentc6418ba9e2ab1c3e91d76a5a5599c3e28dadafc7 (diff)
downloadmariadb-git-5793176bda664c43aab4ec6627515675a4e39ef0.tar.gz
- Avoid the error message "Can't read index header from..."
when copying a small index file because the value returned for $length is < 1024. This can happen if the filehandle was open()ed as an UTF-8 encoded file with Unicode characters (In this case read() returns characters not bytes) (Thanks to Mike Bethune) for this hint)
Diffstat (limited to 'scripts/mysqlhotcopy.sh')
-rw-r--r--scripts/mysqlhotcopy.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index af4e6084c59..fe93aa5a1bc 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -635,6 +635,7 @@ sub copy_index
my $to="$target/$file";
my $buff;
open(INPUT, "<$from") || die "Can't open file $from: $!\n";
+ binmode(INPUT, ":raw");
my $length=read INPUT, $buff, 2048;
die "Can't read index header from $from\n" if ($length < 1024);
close INPUT;