Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve syntax error message #175

Merged
merged 7 commits into from
Jan 21, 2019
Merged

improve syntax error message #175

merged 7 commits into from
Jan 21, 2019

Conversation

lysu
Copy link
Collaborator

@lysu lysu commented Jan 14, 2019

refine the syntax error message to more compatible MySQL's behavior.

try best to substring from the first token meet error.

because the parser is an independent library, it just outputs a part of the message, the user can pre-append other messages to construct own message.

e.g. In TiDB will pre-append

You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use,

before

line 1 column 29 near \"from t1.a = t2.a;\"

This change is Reviewable

@lysu lysu requested review from tiancaiamao and winkyao January 14, 2019 14:26
@lysu
Copy link
Collaborator Author

lysu commented Jan 14, 2019

@winkyao @tiancaiamao PTAL if free, if ok, I will make tidb/tidb-test use this message :D

@lysu
Copy link
Collaborator Author

lysu commented Jan 16, 2019

@winkyao @tiancaiamao

@tiancaiamao
Copy link
Collaborator

LGTM

@lysu lysu requested a review from jackysp January 21, 2019 06:22
jackysp
jackysp previously approved these changes Jan 21, 2019
Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

@lysu lysu merged commit 4b899f1 into pingcap:master Jan 21, 2019
tiancaiamao pushed a commit to tiancaiamao/parser that referenced this pull request Apr 27, 2021
lyonzhi pushed a commit to lyonzhi/parser that referenced this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants