diff --git a/dumpling/v4/export/sql.go b/dumpling/v4/export/sql.go index 655d9c2b8a571..d40b4a1e78203 100644 --- a/dumpling/v4/export/sql.go +++ b/dumpling/v4/export/sql.go @@ -967,7 +967,7 @@ func parseSnapshotToTSO(pool *sql.DB, snapshot string) (uint64, error) { if !tso.Valid { return 0, errors.Errorf("snapshot %s format not supported. please use tso or '2006-01-02 15:04:05' format time", snapshot) } - return (uint64(tso.Int64)<<18)*1000 + 1, nil + return (uint64(tso.Int64) << 18) * 1000, nil } func buildWhereCondition(conf *Config, where string) string { diff --git a/dumpling/v4/export/sql_test.go b/dumpling/v4/export/sql_test.go index 7d8c94addb59c..5689f3ee15584 100644 --- a/dumpling/v4/export/sql_test.go +++ b/dumpling/v4/export/sql_test.go @@ -317,7 +317,7 @@ func (s *testSQLSuite) TestParseSnapshotToTSO(c *C) { WillReturnRows(sqlmock.NewRows([]string{`unix_timestamp("2020/07/18 20:31:50")`}).AddRow(1595075510)) tso, err := parseSnapshotToTSO(db, snapshot) c.Assert(err, IsNil) - c.Assert(tso, Equals, (unixTimeStamp<<18)*1000+1) + c.Assert(tso, Equals, (unixTimeStamp<<18)*1000) c.Assert(mock.ExpectationsWereMet(), IsNil) // generate columns not valid snapshot