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 INDEX .. VISIBLE/INVISIBLE syntax #518

Merged
merged 6 commits into from
Aug 26, 2019
Merged

Fix CREATE INDEX .. VISIBLE/INVISIBLE syntax #518

merged 6 commits into from
Aug 26, 2019

Conversation

zhenghaoz
Copy link
Contributor

@zhenghaoz zhenghaoz commented Aug 23, 2019

What problem does this PR solve?

Fix CREATE INDEX .. VISIBLE/INVISIBLE syntax

Issue: #478

MySQL Syntax:

CREATE [UNIQUE | FULLTEXT | SPATIAL] INDEX index_name
...
index_option:
....
   | {VISIBLE | INVISIBLE}

Bad SQL Case:

CREATE INDEX idx ON t ( a ) VISIBLE
CREATE INDEX idx ON t ( a ) INVISIBLE
CREATE INDEX idx ON t ( a ) USING HASH VISIBLE
CREATE INDEX idx ON t ( a ) USING HASH INVISIBLE
CREATE INDEX idx ON t ( a ) INVISIBLE VISIBLE
CREATE INDEX idx ON t ( a ) VISIBLE INVISIBLE

Check List

Tests

  • Unit test

PS:

Since the default option is visible, VISIBLE won't be restored.

  • VISIBLE, INVISIBLE

Specify index visibility. Indexes are visible by default. An invisible index is not used by the optimizer. Specification of index visibility applies to indexes other than primary keys (either explicit or implicit). For more information, see Section 8.3.12, “Invisible Indexes”.

@zhenghaoz zhenghaoz changed the title Fix/create index visible invisible Fix CREATE INDEX .. VISIBLE/INVISIBLE syntax Aug 23, 2019
parser.y Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 24, 2019

Codecov Report

Merging #518 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #518      +/-   ##
==========================================
+ Coverage   71.67%   71.68%   +0.01%     
==========================================
  Files          32       32              
  Lines        7752     7756       +4     
==========================================
+ Hits         5556     5560       +4     
  Misses       1671     1671              
  Partials      525      525
Impacted Files Coverage Δ
parser.go 70.58% <ø> (ø) ⬆️
misc.go 96.49% <ø> (ø) ⬆️
ast/ddl.go 80.27% <100%> (+0.04%) ⬆️

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 091e94e...bc0d059. Read the comment docs.

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.

LGTM

zier-one
zier-one previously approved these changes Aug 26, 2019
Copy link
Contributor

@zier-one zier-one left a comment

Choose a reason for hiding this comment

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

LGTM

@zier-one zier-one added status/LGT2 LGT2 and removed status/LGT1 LGT1 labels Aug 26, 2019
@zier-one
Copy link
Contributor

resolve conflicts please

…reate_index_visible_invisible

# Conflicts:
#	parser.go
@zier-one zier-one merged commit ae83161 into pingcap:master Aug 26, 2019
@zhenghaoz zhenghaoz deleted the fix/create_index_visible_invisible branch October 22, 2019 01:13
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.

3 participants