Skip to content

Commit

Permalink
fix: not set pos to end
Browse files Browse the repository at this point in the history
  • Loading branch information
buchuitoudegou committed Dec 29, 2022
1 parent c8124a0 commit db98061
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion br/pkg/lightning/mydump/csv_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/pingcap/tidb/br/pkg/lightning/worker"
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/util/mathutil"
"go.uber.org/zap"
)

var (
Expand Down Expand Up @@ -341,7 +342,7 @@ func (parser *CSVParser) readUntil(chars *byteSet) ([]byte, byte, error) {
if err == nil {
err = io.EOF
}
parser.pos += int64(len(buf))
// parser.pos += int64(len(buf))
return buf, 0, errors.Trace(err)
}
index := IndexAnyByte(parser.buf, chars)
Expand Down Expand Up @@ -450,6 +451,7 @@ func (parser *CSVParser) readQuotedField() error {
content, terminator, err := parser.readUntil(&parser.quoteByteSet)
err = parser.replaceEOF(err, errUnterminatedQuotedField)
if err != nil {
parser.Logger.Error("err content", zap.ByteString("content", content))
return err
}
parser.recordBuffer = append(parser.recordBuffer, content...)
Expand Down

0 comments on commit db98061

Please sign in to comment.