Skip to content

sql: reject SET TRANSACTION access modes at plan time#37436

Open
def- wants to merge 2 commits into
MaterializeInc:mainfrom
def-:pr-set-transaction
Open

sql: reject SET TRANSACTION access modes at plan time#37436
def- wants to merge 2 commits into
MaterializeInc:mainfrom
def-:pr-set-transaction

Conversation

@def-

@def- def- commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

The sequencer applied each transaction mode's side effect in order before rejecting access modes, so SET ... ISOLATION LEVEL x READ WRITE changed the session isolation level and then errored, leaving it silently changed. Reject access modes in the planner (like plan_start_transaction) so no partial state is applied. Adds an SLT regression test.

The sequencer applied each transaction mode's side effect in order before
rejecting access modes, so `SET ... ISOLATION LEVEL x READ WRITE` changed the
session isolation level and then errored, leaving it silently changed. Reject
access modes in the planner (like `plan_start_transaction`) so no partial
state is applied. Adds an SLT regression test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@def- def- requested a review from SangJunBak July 3, 2026 15:54
@def- def- requested a review from a team as a code owner July 3, 2026 15:54
Rejecting SET TRANSACTION access modes via bail_unsupported! routed the
error through the catch-all PlanError arm in AdapterError::code(),
regressing the SQLSTATE from 0A000 (feature_not_supported) to XX000
(internal_error) and violating the SQL-326 invariant. Classify
PlanError::Unsupported as FEATURE_NOT_SUPPORTED in both the AdapterError
and OptimizerError paths, fixing every bail_unsupported! site.

Update the stale sqllogictest message and add a pgtest that pins the
0A000 SQLSTATE so the classification cannot silently regress again.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant