Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Fix ANTLR grammar for negative integer and floating point number #489

Conversation

dai-chen
Copy link
Member

@dai-chen dai-chen commented May 26, 2020

Issue #, if available: #488

Description of changes: Fixed the wrong ANTLR grammar by removing dash from beginning of ID literal. This makes dash only be able to present in the middle of an identifier. So negative number started with dash won't be matched by ID.

Original MySQL grammar: https://github.com/antlr/grammars-v4/blob/master/sql/mysql/Positive-Technologies/MySqlLexer.g4#L1197

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dai-chen dai-chen self-assigned this May 26, 2020
@dai-chen dai-chen added the bug Something isn't working label May 26, 2020
@dai-chen dai-chen marked this pull request as ready for review May 26, 2020 20:06
Copy link
Contributor

@penghuo penghuo left a comment

Choose a reason for hiding this comment

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

Thanks for the change.

Copy link
Contributor

@abbashus abbashus left a comment

Choose a reason for hiding this comment

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

Thanks for the change

@dai-chen dai-chen merged commit 68cc694 into opendistro-for-elasticsearch:master May 27, 2020
@dai-chen dai-chen deleted the fix-negative-floating-point-number branch May 27, 2020 17:05
penghuo pushed a commit to penghuo/sql that referenced this pull request Jun 17, 2020
…ndistro-for-elasticsearch#489)

* Change grammar and add UT for negative number test

* Add IT for negative number syntax check

(cherry picked from commit 68cc694)
penghuo pushed a commit that referenced this pull request Jun 17, 2020
* Change grammar and add UT for negative number test

* Add IT for negative number syntax check

(cherry picked from commit 68cc694)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants