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

TableName rule should not derive to Identifier '.' '*' #357

Closed
kennytm opened this issue Jun 19, 2019 · 1 comment · Fixed by #521
Closed

TableName rule should not derive to Identifier '.' '*' #357

kennytm opened this issue Jun 19, 2019 · 1 comment · Fixed by #521

Comments

@kennytm
Copy link
Contributor

kennytm commented Jun 19, 2019

In fix of #188, the following new rule was introduced:

parser/parser.y

Lines 4886 to 4898 in 690470b

TableName:
Identifier
{
$$ = &ast.TableName{Name:model.NewCIStr($1)}
}
| Identifier '.' Identifier
{
$$ = &ast.TableName{Schema:model.NewCIStr($1), Name:model.NewCIStr($3)}
}
| Identifier '.' '*'
{
$$ = &ast.TableName{Name:model.NewCIStr($1)}
}

but this affects all uses of TableName and leads to some non-sense syntax being accepted, e.g.

ANALYZE TABLE a.*;
-- should throw syntax error, but accepted and treated as equivalent to ANALYZE TABLE a;

We should create a separate rule for DELETE statement instead, and revert the TableName change.

@spongedu
Copy link
Contributor

spongedu commented Sep 7, 2019

This issue seems be fixed in #521 . I've added some related test cases in that pr. PTAL. @kennytm

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 a pull request may close this issue.

2 participants