Skip to content

Commit

Permalink
Merge branch 'master' into micali
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei authored Dec 12, 2022
2 parents 7e4b2d2 + ee5d8cc commit ba61a39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sessiontxn/staleread/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,18 +280,18 @@ func TestStaleReadProcessorWithExecutePreparedStmt(t *testing.T) {
tk.MustExec("set @@tx_read_ts=''")

// `@@tidb_read_staleness`
tk.MustExec("set @@tidb_read_staleness=-5")
tk.MustExec("set @@tidb_read_staleness=-100")
processor = createProcessor(t, tk.Session())
err = processor.OnExecutePreparedStmt(nil)
require.True(t, processor.IsStaleness())
require.Equal(t, int64(0), processor.GetStalenessInfoSchema().SchemaMetaVersion())
expectedTS, err := staleread.CalculateTsWithReadStaleness(tk.Session(), -5*time.Second)
expectedTS, err := staleread.CalculateTsWithReadStaleness(tk.Session(), -100*time.Second)
require.NoError(t, err)
require.Equal(t, expectedTS, processor.GetStalenessReadTS())
tk.MustExec("set @@tidb_read_staleness=''")

// `@@tidb_read_staleness` will be ignored when `as of` or `@@tx_read_ts`
tk.MustExec("set @@tidb_read_staleness=-5")
tk.MustExec("set @@tidb_read_staleness=-100")
processor = createProcessor(t, tk.Session())
err = processor.OnExecutePreparedStmt(func(sctx sessionctx.Context) (uint64, error) {
return p1.ts, nil
Expand Down

0 comments on commit ba61a39

Please sign in to comment.