Skip to content

Commit

Permalink
feat: allow non-reserved-keywords for index names
Browse files Browse the repository at this point in the history
Signed-off-by: Manan Gupta <[email protected]>
  • Loading branch information
GuptaManan100 committed Apr 1, 2024
1 parent b2e5ce7 commit 12703b1
Show file tree
Hide file tree
Showing 3 changed files with 4,837 additions and 4,783 deletions.
20 changes: 20 additions & 0 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1767,6 +1767,24 @@ var (
}, {
input: "alter schema d collate = 'utf8_bin' character set = geostd8 character set = geostd8",
output: "alter database d collate 'utf8_bin' character set geostd8 character set geostd8",
}, {
input: `DROP INDEX Indexes ON mydb.mytable`,
output: "alter table mydb.mytable drop key `Indexes`",
}, {
input: `create index Indexes on b (col1)`,
output: "alter table b add key `Indexes` (col1)",
}, {
input: `create fulltext index Indexes on b (col1)`,
output: "alter table b add fulltext key `Indexes` (col1)",
}, {
input: `create spatial index Indexes on b (col1)`,
output: "alter table b add spatial key `Indexes` (col1)",
}, {
input: "alter table a alter index indexes visible, alter index indexes invisible",
output: "alter table a alter index `indexes` visible, alter index `indexes` invisible",
}, {
input: "alter table a add spatial key indexes (column1)",
output: "alter table a add spatial key `indexes` (column1)",
}, {
input: "create table a",
partialDDL: true,
Expand Down Expand Up @@ -4764,6 +4782,7 @@ func TestCreateTable(t *testing.T) {
primary key (id),
spatial key geom (geom),
fulltext key fts (full_name),
fulltext key indexes (full_name),
unique key by_username (username),
unique key by_username2 (username),
unique key by_username3 (username),
Expand All @@ -4780,6 +4799,7 @@ func TestCreateTable(t *testing.T) {
primary key (id),
spatial key geom (geom),
fulltext key fts (full_name),
fulltext key ` + "`indexes`" + ` (full_name),
unique key by_username (username),
unique key by_username2 (username),
unique key by_username3 (username),
Expand Down
Loading

0 comments on commit 12703b1

Please sign in to comment.