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

parser: fix tableAlias in DeleteStmt #521

Merged
merged 8 commits into from
Nov 26, 2019

Conversation

spongedu
Copy link
Contributor

@spongedu spongedu commented Aug 25, 2019

What problem does this PR solve?

#189 tried to implement Restore for DeleteStmt, but there's a little mistake: the .* syntax should not be defined as part of TableName. It should be defined as an independent term and be used in DeleteStmt only, as is defined in MySQL Parser

This pr seems fix #357 as well.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

Code changes

N / A

Side effects

N / A

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation
  • Need to be included in the release note

@codecov
Copy link

codecov bot commented Aug 25, 2019

Codecov Report

Merging #521 into master will decrease coverage by 8.23%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #521      +/-   ##
==========================================
- Coverage      80%   71.76%   -8.24%     
==========================================
  Files          32       32              
  Lines       12696     7813    -4883     
==========================================
- Hits        10157     5607    -4550     
+ Misses       1935     1676     -259     
+ Partials      604      530      -74
Impacted Files Coverage Δ
parser.go 70.58% <ø> (-22.36%) ⬇️
ast/misc.go 74.46% <0%> (-1.45%) ⬇️
ast/dml.go 73.56% <0%> (-0.41%) ⬇️
ast/functions.go 76.74% <0%> (-0.33%) ⬇️
ast/expressions.go 72.52% <0%> (-0.27%) ⬇️
goyacc/main.go 0% <0%> (ø) ⬆️
charset/charset.go 87.01% <0%> (ø) ⬆️
yy_parser.go 83.46% <0%> (ø) ⬆️
mysql/const.go 25.27% <0%> (ø) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5173e98...11f5ac6. Read the comment docs.

@kennytm
Copy link
Contributor

kennytm commented Aug 26, 2019

CREATE table .t (a bigint)

Since this is invalid in MySQL 8.0 I don't think we want to support this. WDYT @leoppro @tangenta

@spongedu
Copy link
Contributor Author

spongedu commented Aug 27, 2019

CREATE table .t (a bigint)

Since this is invalid in MySQL 8.0 I don't think we want to support this. WDYT @leoppro @tangenta

But currently TiDB and the Parser is mainly MySQL 5.7 compatible, and it seems long way for TiDB and the users to migrate to MySQL 8.0's behavior. I'm not sure if we should ignore the MySQL 5.7 compatible issues now....
BTW, What's the compatibility strategy do we hold for the Parser now? As I've mentioned in #506 , currently the Parser seems a mixture of MySQL 5.7, MySQL 8.0 and MariaDB. @kennytm what do you think about this?

@kennytm
Copy link
Contributor

kennytm commented Aug 27, 2019

@spongedu We intend to be eventually compatible with 8.0 (pingcap/tidb#7968), so if a missing 5.7 feature is deprecated or removed on 8.0 we won't support it (unless it is trivial). Example of such rejected feature requests: pingcap/tidb#3685, pingcap/tidb#4025, pingcap/tidb#10092.

@spongedu
Copy link
Contributor Author

spongedu commented Aug 28, 2019

@spongedu We intend to be eventually compatible with 8.0 (pingcap/tidb#7968), so if a missing 5.7 feature is deprecated or removed on 8.0 we won't support it (unless it is trivial). Example of such rejected feature requests: pingcap/tidb#3685, pingcap/tidb#4025, pingcap/tidb#10092.

OK, I've revert this change. PTAL :) @kennytm @leoppro

@spongedu spongedu changed the title parser: fix TableName and DeleteStmt parser: fix DeleteStmt Aug 28, 2019
@spongedu spongedu changed the title parser: fix DeleteStmt parser: fix tableAlias in DeleteStmt Aug 28, 2019
@spongedu
Copy link
Contributor Author

spongedu commented Sep 7, 2019

@kennytm @leoppro @tangenta PTAL

Copy link
Contributor

@kennytm kennytm left a comment

Choose a reason for hiding this comment

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

Rest LGTM

parser.y Show resolved Hide resolved
parser.y Show resolved Hide resolved
@kennytm kennytm added the status/LGT1 LGT1 label Sep 7, 2019
@spongedu
Copy link
Contributor Author

@crazycs520 PTAL :)

@eurekaka eurekaka removed their request for review October 22, 2019 07:54
SunRunAway
SunRunAway previously approved these changes Nov 7, 2019
Copy link
Contributor

@SunRunAway SunRunAway left a comment

Choose a reason for hiding this comment

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

LGTM

@SunRunAway SunRunAway added status/LGT2 LGT2 and removed status/LGT1 LGT1 labels Nov 7, 2019
@SunRunAway
Copy link
Contributor

SunRunAway commented Nov 7, 2019

@spongedu Please help resolve the conflicting files.

@spongedu spongedu requested a review from a team November 26, 2019 09:30
@ghost ghost requested review from tangenta and removed request for a team November 26, 2019 09:30
@spongedu
Copy link
Contributor Author

@SunRunAway PTAL :)

@sre-bot
Copy link

sre-bot commented Nov 26, 2019

/run-all-tests

@SunRunAway SunRunAway merged commit 22c9e3f into pingcap:master Nov 26, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TableName rule should not derive to Identifier '.' '*'
5 participants