Skip to content

Conversation

@jycor
Copy link
Contributor

@jycor jycor commented May 1, 2025

This PR adds tests for user variables within Stored Procedures.
Additionally, this PR has changes so that we don't double parse PREPARE ... FROM ... statements, which also allows them to be used in the updated Stored Procedures call.

fixes: dolthub/dolt#8911

Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

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

the changes lgtm, looks like user vars did previously work and these are just tests?

// todo(max): improve name resolution so we can cache post name-binding.
// this involves expression memoization, which currently screws up aggregation
// and order by aliases
prepStmt, _, err := e.Parser.ParseOneWithOptions(ctx, query, sqlMode.ParserOptions())
Copy link
Contributor

Choose a reason for hiding this comment

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

any gut instinct on whether the comment is outdated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

User vars did not work previously in Stored Procedures, but they work better after the rewrite.
It seems like we do cache, so the TODO is outdated(?). Can delete.

@jycor jycor merged commit a36eec4 into main May 2, 2025
8 checks passed
@jycor jycor deleted the james/prep branch May 2, 2025 20:29
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.

can't assign local variables to user variables

3 participants