mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
- 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)
This commit is contained in:
parent
8f97c1232d
commit
c2753d95ee
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue