Skip to content

Commit

Permalink
executor: fix batchget overflow lock panic (#23774) (#23778)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-srebot authored May 8, 2021
1 parent 4195c2b commit b8fb03c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions executor/batch_point_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ func (e *BatchPointGetExec) initialize(ctx context.Context) error {
if err1 != nil && !kv.ErrNotExist.Equal(err1) {
return err1
}
if idxKey == nil {
continue
}
s := hack.String(idxKey)
if _, found := dedup[s]; found {
continue
Expand Down
1 change: 1 addition & 0 deletions session/pessimistic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ func (s *testPessimisticSuite) TestPointGetOverflow(c *C) {
tk.MustExec("create table t(k tinyint, v int, unique key(k))")
tk.MustExec("begin pessimistic")
tk.MustExec("update t set v = 100 where k = -200;")
tk.MustExec("update t set v = 100 where k in (-200, -400);")
}

func (s *testPessimisticSuite) TestPointGetKeyLock(c *C) {
Expand Down

0 comments on commit b8fb03c

Please sign in to comment.