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

Fix STATS_SAMPLE_PAGES syntax #404

Closed
zier-one opened this issue Jul 29, 2019 · 4 comments
Closed

Fix STATS_SAMPLE_PAGES syntax #404

zier-one opened this issue Jul 29, 2019 · 4 comments

Comments

@zier-one
Copy link
Contributor

Index Issue: pingcap/tidb#11486

These are bad (incompatible) SQL cases:

ALTER TABLE t STATS_SAMPLE_PAGES 10
ALTER TABLE t STATS_SAMPLE_PAGES 0x0aaa , LOCK DEFAULT
ALTER TABLE t STATS_SAMPLE_PAGES = 123
ALTER TABLE t STATS_SAMPLE_PAGES = 11.11 AVG_ROW_LENGTH 11
ALTER TABLE t STATS_SAMPLE_PAGES = 10 MIN_ROWS = 12

Claim this subtask based on the comments below this issue.

@leiysky
Copy link
Contributor

leiysky commented Jul 30, 2019

Let me fix it

@zier-one
Copy link
Contributor Author

Let me fix it

ok thanks

@leiysky
Copy link
Contributor

leiysky commented Jul 30, 2019

parser/ast/ddl.go

Lines 1589 to 1594 in 2414ee7

case TableOptionStatsPersistent:
// TODO: not support
ctx.WriteKeyWord("STATS_PERSISTENT ")
ctx.WritePlain("= ")
ctx.WriteKeyWord("DEFAULT")
ctx.WritePlain(" /* TableOptionStatsPersistent is not supported */ ")

Should I handle it in this way or append a warning in parser.y?

@zier-one
Copy link
Contributor Author

zier-one commented Jul 30, 2019

no, if we can't restore sql text from ast, we throw a warn in Restore
but in this case, the ast include intact sql stmt data, so we don't need to throw a warn in Restore.

tidb don't support this feature, so we make a warn in parser

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

No branches or pull requests

2 participants