diff --git a/lightning/restore/restore.go b/lightning/restore/restore.go index 6ba30def8..da3d9d3b3 100644 --- a/lightning/restore/restore.go +++ b/lightning/restore/restore.go @@ -18,17 +18,17 @@ import ( "github.com/cznic/mathutil" sstpb "github.com/pingcap/kvproto/pkg/import_sstpb" "github.com/pingcap/parser/model" + tidbcfg "github.com/pingcap/tidb/config" + "github.com/pingcap/tidb/meta/autoid" + "github.com/pingcap/tidb/util/kvencoder" + "github.com/pkg/errors" + "github.com/pingcap/tidb-lightning/lightning/common" "github.com/pingcap/tidb-lightning/lightning/config" "github.com/pingcap/tidb-lightning/lightning/kv" "github.com/pingcap/tidb-lightning/lightning/metric" "github.com/pingcap/tidb-lightning/lightning/mydump" verify "github.com/pingcap/tidb-lightning/lightning/verification" - tidbcfg "github.com/pingcap/tidb/config" - "github.com/pingcap/tidb/meta/autoid" - "github.com/pingcap/tidb/util/hack" - "github.com/pingcap/tidb/util/kvencoder" - "github.com/pkg/errors" ) const ( @@ -1387,7 +1387,7 @@ func (cr *chunkRestore) restore( // sql -> kv start = time.Now() - kvs, _, err := kvEncoder.SQL2KV(hack.String(buffer.Bytes())) + kvs, _, err := kvEncoder.SQL2KV(string(buffer.Bytes())) encodeDur := time.Since(start) encodeTotalDur += encodeDur metric.BlockEncodeSecondsHistogram.Observe(encodeDur.Seconds())