Skip to content

Commit

Permalink
opt: enable implicit SELECT FOR UPDATE locking in opt tests
Browse files Browse the repository at this point in the history
Implicit `SELECT ... FOR UPDATE` locking has been enabled in optimizer
tests, matching the default value for the corresponding session setting
`enable_implicit_select_for_update`.

Release note: None
  • Loading branch information
mgartner committed Jul 26, 2024
1 parent 67cd6f1 commit d7f9c50
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/sql/opt/exec/explain/testdata/gists
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ explain(shape):
└── • scan
table: abc@abc_pkey
spans: 1+ spans
locking strength: for update
explain(gist):
• update
│ table: abc
Expand Down Expand Up @@ -679,6 +680,7 @@ explain(shape):
└── • scan
table: abc@abc_pkey
spans: 1+ spans
locking strength: for update
explain(gist):
• upsert
│ into: abc()
Expand Down
1 change: 1 addition & 0 deletions pkg/sql/opt/exec/explain/testdata/gists_tpce
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ explain(shape):
│ └── • scan
│ table: last_trade@last_trade_pkey
│ spans: 1+ spans
│ locking strength: for update
├── • subquery
│ │ id: @S2
Expand Down
1 change: 0 additions & 1 deletion pkg/sql/opt/testutils/opttester/opt_tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ func New(catalog cat.Catalog, sqlStr string) *OptTester {
ot.evalCtx.SessionData().UserProto = username.MakeSQLUsernameFromPreNormalizedString("opttester").EncodeProto()
ot.evalCtx.SessionData().Database = "defaultdb"
ot.evalCtx.SessionData().ZigzagJoinEnabled = true
ot.evalCtx.SessionData().ImplicitSelectForUpdate = false

return ot
}
Expand Down

0 comments on commit d7f9c50

Please sign in to comment.