Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: yisaer <disxiaofei@163.com>

fix test

Signed-off-by: yisaer <disxiaofei@163.com>
  • Loading branch information
Yisaer committed May 21, 2021
1 parent 7f7643f commit 8e32482
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sessionctx/variable/varsutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/pingcap/parser/charset"
"github.com/pingcap/parser/mysql"
"github.com/pingcap/tidb/config"
"github.com/pingcap/tidb/store/tikv/oracle"
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/util/collate"
"github.com/pingcap/tidb/util/timeutil"
Expand Down Expand Up @@ -461,7 +462,7 @@ func setSnapshotTS(s *SessionVars, sVal string) error {
}

t1, err := t.GoTime(s.TimeZone)
s.SnapshotTS = GoTimeToTS(t1)
s.SnapshotTS = oracle.GoTimeToTS(t1)
return err
}

Expand All @@ -478,14 +479,13 @@ func setTxnReadTS(s *SessionVars, sVal string) error {
if err != nil {
return err
}
s.TxnReadTS = GoTimeToTS(t1)
s.TxnReadTS = oracle.GoTimeToTS(t1)
return err
}

// GoTimeToTS converts a Go time to uint64 timestamp.
func GoTimeToTS(t time.Time) uint64 {
ts := (t.UnixNano() / int64(time.Millisecond)) << epochShiftBits
return uint64(ts)
return oracle.GoTimeToTS(t)
}

// serverGlobalVariable is used to handle variables that acts in server and global scope.
Expand Down

0 comments on commit 8e32482

Please sign in to comment.