-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add Delete / Update modifiers for MySQL #1254 #1396
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
Add Delete / Update modifiers for MySQL #1254 #1396
Conversation
startJoins=JoinsList() | ||
|
||
<K_UPDATE> { update.setOracleHint(getOracleHint()); } | ||
[(tk = <K_LOW_PRIORITY>) |
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.
Pardon me, I do not understand that line: would the token not always be "LOW_PRIORITY" and so modifierPriority = UpdateModifierPriority.LOW_PRIORITY?
Why would we not write this as
[ <K_LOW_PRIORITY> { modifierPriority = UpdateModifierPriority.LOW_PRIORITY; } ]
Am I missing something please?
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.
I fix that ok. I copy the logic from INSERT priority but they have more values...
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.
Apologies, I was not verbose enough. You can replace:
[(tk = <K_LOW_PRIORITY>)
{if (tk!=null)
modifierPriority = DeleteModifierPriority.LOW_PRIORITY;
}]
with a simple
[ <K_LOW_PRIORITY> { modifierPriority = UpdateModifierPriority.LOW_PRIORITY; } ]
Just showing the possibilities, you can leave as it is and let the compiler do the work.
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.
My fault sry ^^. Do I need something in this PR regarding your comment here ? #1382 (comment)
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 I need something in this PR regarding your comment here ? #1382 (comment)
No, you did good.
I just used your contribution as an example, why we need to work on the Reserved Keyword Management in general and it is not certain, if @wumpz will like my idea. If he does, then your new token QUICK
will be handled automatically. If he does not, we can add it any time later to the Allowed Keywords.
Managing Reserved Keywords
in a JavaCC Grammar is a bit weird and not straight forward.
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.
Ok no problem, thanks for the review anyway.
Thank you so much for the contribution, good stuff!
|
Fixes Update ignore and delete ignore not parseable #1254
Add IGNORE parser/deparse for DELETE and UPDATE.
I find also two modifiers not available for MySQL so I also add LOW_PRIORITY modifier for DELETE and UPDATE, and QUICK modifier for DELETE.
Documentation : https://dev.mysql.com/doc/refman/8.0/en/update.html https://dev.mysql.com/doc/refman/8.0/en/delete.html
Example queries: