Skip to content

MDEV-41606 Support line comments in optimizer hints - #5935

Open
Chaitanya-970 wants to merge 1 commit into
MariaDB:mainfrom
Chaitanya-970:mdev-41606-hint-comments
Open

Chaitanya-970 wants to merge 1 commit into
MariaDB:mainfrom
Chaitanya-970:mdev-41606-hint-comments

Conversation

@Chaitanya-970

Copy link
Copy Markdown

Implements MDEV-41606.

Optimizer hints currently reject SQL-style -- comments, causing the whole hint block to be ignored. Teach the tokenizer to skip line comments between tokens, using the SQL lexer's whitespace and control-character rule.

The regression covers comments between hints and arguments, quoted identifiers, trailing comments, CRLF input and syntax-error line numbers.

Tested on a Linux Debug build:

  • All 15 optimizer-hint tests passed.
  • The new test also passed with --ps-protocol and --cursor-protocol.
  • The new test fails against the unmodified server.

I submit this contribution under the BSD-new license.

Optimizer hints reject SQL-style -- comments, causing the whole hint
block to be ignored. Skip line comments between tokens using the SQL
lexer's whitespace and control-character rule.

Add regression coverage for comments between hints and arguments,
quoted identifiers, trailing comments, CRLF input and diagnostic line
numbers.

Assisted-by: Codex:gpt-6-astra
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants