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

refactor create procedure and call procedure #2833

Merged
merged 37 commits into from
Feb 7, 2025
Merged

refactor create procedure and call procedure #2833

merged 37 commits into from
Feb 7, 2025

Conversation

jycor
Copy link
Contributor

@jycor jycor commented Jan 28, 2025

This PR refactors a ton of the stored procedure behavior to more closely match MySQL.

Changes:

  • properly error when creating procedures/triggers/events in other stored routines
  • allow create procedure statements that reference symbols (tables, views, procedures, etc) that don't exist (yet).
  • remove unnecessary analysis and building work
  • simplify building plan.Call nodes

Partially addresses: dolthub/dolt#8053

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 shape of the changes looks good, if all tests pass it seems like a good directional improvement even if it's still missing correctness edge cases.

sql/plan/ddl_procedure.go Outdated Show resolved Hide resolved

// limit validation
case *ast.Select:
if s.Limit != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

the limit/offset in analyzer seems like it does a lot, was this for a specific test that regular analyzer loop doesn't catch?

Copy link
Contributor Author

@jycor jycor Feb 7, 2025

Choose a reason for hiding this comment

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

Yep, create procedure needs to check that the limit/offset value is actually a numeric.

sql/analyzer/replace_count_star.go Outdated Show resolved Hide resolved
@jycor jycor merged commit c631117 into main Feb 7, 2025
8 checks passed
@jycor jycor deleted the james/proc branch February 7, 2025 19:43
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.

2 participants