From bbedd4a8522f5c12cd25039356d38f6609d417fe Mon Sep 17 00:00:00 2001 From: groot Date: Fri, 30 Sep 2022 17:42:57 +0800 Subject: [PATCH] Fix a bug of backup/restore (#19585) Signed-off-by: yhmo Signed-off-by: yhmo --- internal/util/importutil/binlog_adapter.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/util/importutil/binlog_adapter.go b/internal/util/importutil/binlog_adapter.go index 5993479b7f..55ad7a5886 100644 --- a/internal/util/importutil/binlog_adapter.go +++ b/internal/util/importutil/binlog_adapter.go @@ -514,8 +514,9 @@ func (p *BinlogAdapter) getShardingListByPrimaryInt64(primaryKeys []int64, shardList := make([]int32, 0, len(primaryKeys)) for i, key := range primaryKeys { // if this entity's timestamp is greater than the tsEndPoint, set shardID = -1 to skip this entity + // timestamp is stored as int64 type in log file, actually it is uint64, compare with uint64 ts := timestampList[i] - if ts > int64(p.tsEndPoint) { + if uint64(ts) > p.tsEndPoint { shardList = append(shardList, -1) excluded++ continue @@ -565,8 +566,9 @@ func (p *BinlogAdapter) getShardingListByPrimaryVarchar(primaryKeys []string, shardList := make([]int32, 0, len(primaryKeys)) for i, key := range primaryKeys { // if this entity's timestamp is greater than the tsEndPoint, set shardID = -1 to skip this entity + // timestamp is stored as int64 type in log file, actually it is uint64, compare with uint64 ts := timestampList[i] - if ts > int64(p.tsEndPoint) { + if uint64(ts) > p.tsEndPoint { shardList = append(shardList, -1) excluded++ continue