opt: minor fixes for queries that perform locking #141964
Open
+122
−32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
opt: only set volatile for scans that perform locking
This commit makes a minor change to the logical properties for scan
operators. The volatile property is now only set for a scan that takes
locks, rather than any scan with non-default locking.
Epic: None
Release note: None
opt: set volatility for locking operators
This commit sets the volatile property for operators that perform locking,
other than Scan, which was already handled. In most cases there is already
a locking scan below these operators, so there are few plan changes. This
is necessary for a following commit, which will cause
Lock
operators tono longer be considered mutation operators (which was previously causing
volatility to be set).
Epic: None
Release note: None
opt: remove Mutation tag from lock operators
This commit removes the
Mutation
tag from the optimizer lock operator.As a result, errors that result from checking
opt.IsMutationOp
orplanFlagContainsMutation
will no longer incorrectly occur for plansthat contain lock operators.
Fixes #141961
Release note: None
plpgsql: don't make cursors with locking holdable
This commit changes the
close_cursors_at_commit
setting to be moreOracle-compatible. Now, disabling the setting will cause cursors to
remain open after txn commit only for cursors without locking.
This commit also removes the
Mutation
tag from the optimizer Lockoperator. This is necessary to prevent PL/pgSQL cursors with locking
from returning a
must not contain data-modifying statements
errorunder configurations like read-committed which use lock operators.
Lock operators are equivalent to lookup joins with Locking set, so
the change is correct.
Informs #77101
Release note: None