Commit 68861d9
authored
feat(mysql)!: support
* feat(mysql): support `DROP PRIMARY KEY`.
This commit adds support for `ALTER TABLE t DROP PRIMARY KEY` for MySQL.
I followed the general pattern of `DropPartition`, as it looked most
extensible to other database vendors (eg. BigQuery, Oracle, Snowflake,
Databricks) based on a sampling of syntax.
* fix(parser): Move `DROP PRIMARY KEY` into MySQL.
In my previous commit, I put the `DROP PRIMARY KEY` into the general
parser, but that caused regressions for non-MySQL dialects. This commit
tries to bridge the gap: keep the extensibility open for other dialects
to use the `DropPrimaryKey`, but only when implemented.DROP PRIMARY KEY. (#7530)1 parent f3bf070 commit 68861d9
6 files changed
Lines changed: 22 additions & 1 deletion
File tree
- sqlglot
- expressions
- parsers
- tests/dialects
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
357 | 361 | | |
358 | 362 | | |
359 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4041 | 4041 | | |
4042 | 4042 | | |
4043 | 4043 | | |
| 4044 | + | |
| 4045 | + | |
| 4046 | + | |
4044 | 4047 | | |
4045 | 4048 | | |
4046 | 4049 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8503 | 8503 | | |
8504 | 8504 | | |
8505 | 8505 | | |
| 8506 | + | |
| 8507 | + | |
| 8508 | + | |
8506 | 8509 | | |
8507 | 8510 | | |
8508 | 8511 | | |
| |||
8613 | 8616 | | |
8614 | 8617 | | |
8615 | 8618 | | |
8616 | | - | |
| 8619 | + | |
8617 | 8620 | | |
8618 | 8621 | | |
8619 | 8622 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
313 | 318 | | |
314 | 319 | | |
315 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
0 commit comments