-
Notifications
You must be signed in to change notification settings - Fork 23
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
Added CREATE PROCEDURE & FUNCTION #46
Conversation
|
Sadly you do need to deal with the shift/reduce conflicts. They're a pain, but you can't actually guarantee a correct parse unless you eliminate them. The way to debug them is to examine the .output file when you run goyacc. goyacc -o sql.go sql.y Produces a log called These conflicts happen when the grammar has ambiguity, so when there is a place in the input where two different different rules could be applied next. Can't have it. The most common approach to eliminating these is to combine multiple rules into one to eliminate the ambiguity, which you can see was done various places in the grammar (read the comments). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks pretty reasonable, nice work. I'll take another look when you sort out the conflicts in the grammar.
@@ -2080,9 +2310,21 @@ show_statement: | |||
{ | |||
$$ = &Show{Type: string($2)} | |||
} | |||
| SHOW PROCEDURE ddl_skip_to_end | |||
| SHOW PROCEDURE CODE ddl_skip_to_end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you actually want the skips on these? Typically those are for unsupported / semi-supported features
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't support the CODE
ones for now, which are different than the STATUS
ones. We probably won't ever support the CODE
ones tbh. They return something that looks like some kind of MySQL IL.
c2b4c04
to
4e0613f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
4e0613f
to
f72720c
Compare
This adds:
The
SHOW...CODE
statements are being skipped for now, as they're relatively unused compared to the above statements. Additionally, theCREATE
statements do not have a fully fleshed-out routine body, as we currently do not parse all valid statements anyway.