Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented DECLARE support for variables and cursors #1440

Merged
merged 1 commit into from
Dec 6, 2022

Conversation

Hydrocharged
Copy link
Contributor

This adds support for DECLARE variables and cursors. I implemented nesting support by giving all variables a procedure-unique ID, with the scope determining which ID is resolved. A flat slice of IDs are far simpler to track than a proper tree structure.

I did skip one test for GMS, as a RowIter reads the current state of the table, rather than the state that the RowIter generated with.

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay

Overall this looks quite good, well done.

Mostly suggestions for naming and comments, requests for additional tests.

enginetest/queries/procedure_queries.go Show resolved Hide resolved
sql/analyzer/declare.go Outdated Show resolved Hide resolved
sql/analyzer/declare.go Outdated Show resolved Hide resolved
sql/analyzer/declare.go Outdated Show resolved Hide resolved
sql/analyzer/declare.go Show resolved Hide resolved
sql/analyzer/declare.go Show resolved Hide resolved
sql/expression/procedureparam.go Outdated Show resolved Hide resolved
sql/expression/procedureparam.go Outdated Show resolved Hide resolved
sql/parse/parse.go Show resolved Hide resolved
sql/plan/close.go Outdated Show resolved Hide resolved
@Hydrocharged Hydrocharged merged commit 6d7c99c into main Dec 6, 2022
@Hydrocharged Hydrocharged deleted the daylon/sp-vars-cursors branch December 6, 2022 11:46
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.

3 participants