Commit 9f72b55
committed
fix(parser): support MySQL index options in CREATE INDEX and DROP INDEX
Several valid MySQL index DDL statements were rejected because their option
keywords are tokens of their own and were therefore not reachable from the
option lists that CREATE INDEX and DROP INDEX use:
CREATE INDEX i ON t (c1) KEY_BLOCK_SIZE = 8
CREATE INDEX i ON t (c1) ALGORITHM = INPLACE LOCK = NONE
CREATE FULLTEXT INDEX i ON t (body) WITH PARSER ngram
CREATE SPATIAL INDEX i ON t (g)
DROP INDEX i ON t ALGORITHM = INPLACE LOCK = NONE
The keywords are added to the existing flat token lists of CreateParameter()
and Drop() rather than as new grammar alternatives, so no new choice is
introduced and the JavaCC warning count is unchanged.
LOCK is the one exception: it also starts a LOCK TABLE statement, so taking it
unconditionally as a DROP argument would be ambiguous with the next statement.
It is guarded by a semantic lookahead that only accepts it when it is not
followed by TABLE.
Refs #24901 parent 39bd1f6 commit 9f72b55
3 files changed
Lines changed: 68 additions & 0 deletions
File tree
- src
- main/jjtree/net/sf/jsqlparser/parser
- test/java/net/sf/jsqlparser/statement
- create
- drop
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11863 | 11863 | | |
11864 | 11864 | | |
11865 | 11865 | | |
| 11866 | + | |
| 11867 | + | |
| 11868 | + | |
| 11869 | + | |
| 11870 | + | |
11866 | 11871 | | |
11867 | 11872 | | |
11868 | 11873 | | |
| |||
12038 | 12043 | | |
12039 | 12044 | | |
12040 | 12045 | | |
| 12046 | + | |
| 12047 | + | |
| 12048 | + | |
12041 | 12049 | | |
12042 | 12050 | | |
12043 | 12051 | | |
12044 | 12052 | | |
12045 | 12053 | | |
| 12054 | + | |
| 12055 | + | |
| 12056 | + | |
| 12057 | + | |
| 12058 | + | |
12046 | 12059 | | |
12047 | 12060 | | |
12048 | 12061 | | |
| |||
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
199 | 237 | | |
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
155 | 172 | | |
0 commit comments