GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Preserve MySQL double-dash and executable-comment semantics by minleejae · Pull Request #2728 · JSQLParser/JSqlParser

Conversation

@minleejae

@minleejae minleejae commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

In MySQL mode, SELECT 1--2 currently becomes SELECT 1, and SELECT 1 /*! +2 */ loses executable SQL. Handle the MySQL double-dash whitespace rule and executable-comment boundaries in the shared character stream so String, Reader, InputStream, expression and statement APIs use the same rules. Quoted content and optimizer hints retain their existing behavior.

Unversioned /*! ... */ contents become regular SQL tokens. Conditional comments require an explicit withMySqlServerVersion(90702) (or 260700) target; eligible contents are parsed and later-version contents are skipped. Missing targets fail with a lexical diagnostic instead of silently dropping SQL. Output represents SQL for the selected target. This behavior is confined to the MYSQL dialect; documentation explains the configuration and nested executable-comment limitation.

Validation:

  • Full Java 17 Gradle check: 8,988 tests, zero failures/errors, 25 skipped, including 33 focused comment tests; grammar ambiguity, formatting and static analysis passed.
  • MySQL 9.7.2 and 26.7.0: 176 case/profile combinations × original, toString() and deparser output (528 executions), with matching result sets. Profiles: default, ANSI_QUOTES, NO_BACKSLASH_ESCAPES and PIPES_AS_CONCAT.
  • Tests cover expression ASTs and mutation, five/six-digit version prefixes, quote/escape overrides, unterminated comments, rejection without fallback, API consistency, statement boundaries, original token positions, buffer expansion/reinitialization, and other dialects.

Reference: MySQL comment syntax.

Performance smoke checks used the existing JMH SQL corpus plus configured MySQL/PostgreSQL scripts, two forks with GC allocation profiling. Existing-corpus allocation was approximately 7.80 MB/op versus 7.77 MB/op at the base; the configured MySQL script increased by approximately 0.6% in this short run. Timing confidence intervals were wide, so these measurements are not a speed claim. A separate 5,000-executable-comment script preserved both statement boundaries and completed without pathological growth.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@minleejae
Preserve MySQL arithmetic and executable comment semantics
ff4a78b
Signed-off-by: minleejae <[email protected]>
@manticore-projects
manticore-projects merged commit fb1e42a into JSQLParser:master Sep 27, 2026
10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@manticore-projects

manticore-projects commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tanjiroK-coder tanjiroK-coder mentioned this pull request Nov 3, 2026
fix: apply the MySQL comment rules to Dialect.MARIADB #2891
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@minleejae @manticore-projects
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.