Repository navigation
MDEV-41606 Support line comments in optimizer hints - #5935
chaitanya-bhardwaj wants to merge 1 commit into
Conversation
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for your contribution! This is a preliminary review.
It's a good first iteration, but it needs more work IMHO. I have drafted some suggestions to improve the diff below.
Please also add a more detailed description either in the jira and a summary of it into the commit message. This should contribute to better documentation.
This should cover:
- what was the state before (a.k.a. what was wrong)
- what new functionality is added
- what is supposed to work
- what is supposed to not work
- what is missing (if anything)
- how was the feature tested
155805d to
e5e0398
Compare
gkodinov
left a comment
There was a problem hiding this comment.
LGTM. Please stand by for the final review.
2b2d3a5 to
5035a7b
Compare
|
Hi @spetrunia, the latest commit now passes all the checks, including the Windows one. There have also been test and runner changes since Georgi’s approval. Could you take a look when you have time? thanks. |
DaveGosselin-MariaDB
left a comment
There was a problem hiding this comment.
Why are the vector changes included in this PR? I think that they should be reviewed and delivered separately.
Please squash the commits related to MDEV-41606 together into one commit (don't squash unrelated changes into the commit).
A line comment inside an optimizer hint used to trigger a syntax warning and cause MariaDB to ignore the hint block. Allow comments between hint tokens so users can explain or comment out individual hints. Skip comments that start with two dashes followed by whitespace or a control byte inside the hint. Resume scanning at the next newline or at the end of the hint. Quoted names keep their literal dashes. Empty hint blocks and malformed prefixes still warn. The hint syntax still rejects split tokens, # comments and nested block comments. Test the Jira example, comments around punctuation and numbers, and warning line numbers. The test checks that -x still warns and that a hint after a control-byte comment still takes effect. All 15 optimizer-hint tests passed on a Linux debug build. The new test also passed in prepared-statement, cursor and view modes. Assisted-by: Codex:gpt-6-astra
d39e315 to
efea509
Compare
|
thanks dave for the review |
A
--comment inside an optimizer hint used to trigger a syntax warning and cause MariaDB to ignore the hint block. You can now add a note or comment out one hint while the others still work. MDEV-41606Comments can go between hint tokens, including just before a comma. They start with two dashes followed by whitespace or a control byte and end at a newline or the end of the hint. Dashes inside quoted names keep their meaning, and malformed prefixes such as
-xor a bare--still warn.All 15 optimizer-hint tests passed on a Linux debug build. The new test also passed in prepared-statement, cursor and view modes. It checks which hints take effect and catches both a missing second-dash check and a missing control-byte check.
I submit this contribution under the BSD-new license.