Skip to content

Add SET TRANSACTION VARIABLE statement - #4564

Draft
arnaud-lacurie wants to merge 2 commits into
apple/arnaud-lacurie/local-vars/1-storagefrom
apple/arnaud-lacurie/local-vars/2-set
Draft

Add SET TRANSACTION VARIABLE statement#4564
arnaud-lacurie wants to merge 2 commits into
apple/arnaud-lacurie/local-vars/1-storagefrom
apple/arnaud-lacurie/local-vars/2-set

Conversation

@arnaud-lacurie

Copy link
Copy Markdown
Collaborator

Adds grammar for SET TRANSACTION VARIABLE name = constant, replacing
the unimplemented MySQL-fork SET/variableClause dead grammar it
displaces. Dispatches through a new SetLocalVariableConstantAction
(available in every MetadataOperationsFactory, not just the ones
backed by a real catalog, since it only touches the transaction's
session layer) down to the storage added in the previous PR. Tagged
IS_DDL_STATEMENT so the plan cache is bypassed, since the literal
value is baked directly into the ConstantAction.

There's no SQL-level way to read a variable back yet -- that's
GET_VARIABLE, in the next stacked PR -- so this PR's tests assert
directly on Transaction.getLocalVariables().


Stack created with GitHub Stacks CLIGive Feedback 💬

Adds grammar for SET TRANSACTION VARIABLE name = constant, replacing
the unimplemented MySQL-fork SET/variableClause dead grammar it
displaces. Dispatches through a new SetLocalVariableConstantAction
(available in every MetadataOperationsFactory, not just the ones
backed by a real catalog, since it only touches the transaction's
session layer) down to the storage added in the previous PR. Tagged
IS_DDL_STATEMENT so the plan cache is bypassed, since the literal
value is baked directly into the ConstantAction.

There's no SQL-level way to read a variable back yet -- that's
GET_VARIABLE, in the next stacked PR -- so this PR's tests assert
directly on Transaction.getLocalVariables().
Drop a reference to the PR stack structure that doesn't belong in code
comments.
@arnaud-lacurie
arnaud-lacurie force-pushed the apple/arnaud-lacurie/local-vars/2-set branch from ba17541 to 03120e9 Compare September 5, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant