Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
address comments
Browse files Browse the repository at this point in the history
lichunzhu committed Nov 10, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 6073bc2 commit fb59b88
Showing 3 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions br/pkg/lightning/mydump/csv_parser.go
Original file line number Diff line number Diff line change
@@ -573,8 +573,3 @@ func (parser *CSVParser) ReadUntilTerminator() (int64, error) {
}
}
}

// SetRowID sets the rowID in a csv file when we start a compressed file.
func (parser *CSVParser) SetRowID(rowID int64) {
parser.lastRow.RowID = rowID
}
1 change: 1 addition & 0 deletions br/pkg/lightning/mydump/parser.go
Original file line number Diff line number Diff line change
@@ -176,6 +176,7 @@ func (parser *blockParser) SetPos(pos int64, rowID int64) error {
}

// Pos returns the current file offset.
// Attention: for compressed sql/csv files, pos is the position in uncompressed files
func (parser *blockParser) Pos() (pos int64, lastRowID int64) {
return parser.pos, parser.lastRow.RowID
}
3 changes: 1 addition & 2 deletions br/pkg/lightning/restore/chunk_restore_test.go
Original file line number Diff line number Diff line change
@@ -665,7 +665,6 @@ func TestCompressChunkRestore(t *testing.T) {
// Produce a mock table info
p := parser.New()
p.SetSQLMode(mysql.ModeANSIQuotes)
se := tmock.NewContext()
node, err := p.ParseOneStmt(`
CREATE TABLE "table" (
a INT,
@@ -675,7 +674,7 @@ func TestCompressChunkRestore(t *testing.T) {
)
`, "", "")
require.NoError(t, err)
core, err := ddl.MockTableInfo(se, node.(*ast.CreateTableStmt), 0xabcdef)
core, err := ddl.BuildTableInfoFromAST(node.(*ast.CreateTableStmt))
require.NoError(t, err)
core.State = model.StatePublic

0 comments on commit fb59b88

Please sign in to comment.