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 CREATE SPATIAL INDEX syntax #431

Closed
zier-one opened this issue Aug 2, 2019 · 3 comments
Closed

Fix CREATE SPATIAL INDEX syntax #431

zier-one opened this issue Aug 2, 2019 · 3 comments

Comments

@zier-one
Copy link
Contributor

zier-one commented Aug 2, 2019

Index Issue: pingcap/tidb#11486

These are bad (incompatible) SQL cases:

CREATE SPATIAL INDEX ident ON ident . ident ( ident ( 1 ) ) ALGORITHM = DEFAULT
CREATE SPATIAL INDEX ident ON ident . ident ( ident ) KEY_BLOCK_SIZE = 11 LOCK MASTER_SSL
CREATE SPATIAL INDEX ident ON ident . SECONDARY_ENGINE ( ( 1>2 ) DESC ) ALGORITHM DEFAULT LOCK PERSIST
CREATE SPATIAL INDEX ident ON ident ( ( 1>2 ) ) ALGORITHM ident LOCK DEFAULT
CREATE SPATIAL INDEX ident ON ident ( GLOBAL DESC ) ALGORITHM RESTART LOCK DEFAULT
CREATE SPATIAL INDEX ident ON ident ( UNINSTALL ( 1 ) , SHUTDOWN ( 1 ) )
CREATE SPATIAL INDEX ident ON REPLICATE_WILD_IGNORE_TABLE ( SHUTDOWN ( 1 ) DESC , ( 1>2 ) ASC ) INVISIBLE VISIBLE LOCK = ident

Claim this subtask based on the comments below this issue.

@zhenghaoz
Copy link
Contributor

@leoppro Let me fix it ^_^

@zhenghaoz
Copy link
Contributor

Hi. Maybe I need some help.

  1. ASC&DESC: It seems that they are ignored in parser_test.go. Should I ignore it in the new syntax?
  2. LOCK: There are four options LOCK [=] {DEFAULT | NONE | SHARED | EXCLUSIVE}. What should I do with MASTER_SSL, PERSIST and ident?
  3. ALGORITHM: There are three options ALGORITHM [=] {DEFAULT | INPLACE | COPY}. What should I do with ident and RESTART?

Thanks ^_^

PS: MySQL :: MySQL 8.0 Reference Manual :: 13.1.15 CREATE INDEX Syntax

@kennytm
Copy link
Contributor

kennytm commented Aug 10, 2019

In MySQL LOCK = MASTER_SSL can be parsed but will produce a semantic error, so the statement is invalid anyway.

ERROR 1801 (HY000): Unknown LOCK type 'MASTER_SSL'

Similar for ALGORITHM = RESTART

ERROR 1800 (HY000): Unknown ALGORITHM 'RESTART'

Since "if it isn't broken don't fix it", let's keep the rules of LOCK and ALGORITHM unchanged.

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

3 participants