Skip to content

Tokenize empty line comments correctly#2161

Merged
iffyio merged 1 commit intoapache:mainfrom
zyuiop:main
Jan 13, 2026
Merged

Tokenize empty line comments correctly#2161
iffyio merged 1 commit intoapache:mainfrom
zyuiop:main

Conversation

@zyuiop
Copy link
Copy Markdown
Contributor

@zyuiop zyuiop commented Jan 10, 2026

MySQL likes to send "blocky" comments where a line comment is surrounded by empty comments, like so:

--
-- Table structure for table `foo`
--

CREATE TABLE ...

Currently, these comments are tokenized as MINUS, MINUS instead of an empty line comment.
This commits fixes this problem by accepting any kind of whitespace to delimit a line comment.

MySQL likes to send "blocky" comments where a line comment is surrounded by empty comments, like so:

```
--
-- Table structure for table `foo`
--

CREATE TABLE ...
```

Currently, these comments are tokenized as MINUS, MINUS instead of an empty line comment.
This commits fixes this problem by accepting any kind of whitespace to delimit a line comment.
Copy link
Copy Markdown
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @zyuiop!

@iffyio iffyio added this pull request to the merge queue Jan 13, 2026
Merged via the queue into apache:main with commit ee3b622 Jan 13, 2026
10 checks passed
ayman-sigma pushed a commit to sigmacomputing/sqlparser-rs that referenced this pull request Feb 3, 2026
fmguerreiro pushed a commit to fmguerreiro/datafusion-sqlparser-rs that referenced this pull request Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants