Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
lichunzhu committed Dec 8, 2022
1 parent b80b066 commit 0c46408
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions br/pkg/lightning/mydump/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ func calculateFileBytes(ctx context.Context,

readBytes := func() error {
n, err2 := compressReader.Read(bytes)
if err2 != nil && errors.Cause(err2) != io.EOF {
if err2 != nil && errors.Cause(err2) != io.EOF && errors.Cause(err) != io.ErrUnexpectedEOF {
return err2
}
tot += n
Expand All @@ -692,7 +692,7 @@ func calculateFileBytes(ctx context.Context,

if offset == 0 {
err = readBytes()
if err != nil && errors.Cause(err) != io.EOF {
if err != nil && errors.Cause(err) != io.EOF && errors.Cause(err) != io.ErrUnexpectedEOF {
return 0, 0, err
}
pos, err = compressReader.Seek(0, io.SeekCurrent)
Expand All @@ -708,7 +708,7 @@ func calculateFileBytes(ctx context.Context,
break
}
}
if err != nil && errors.Cause(err) != io.EOF {
if err != nil && errors.Cause(err) != io.EOF && errors.Cause(err) != io.ErrUnexpectedEOF {
return 0, 0, errors.Trace(err)
}
return tot, offset, nil
Expand Down

0 comments on commit 0c46408

Please sign in to comment.