-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
refactor index validation and prevent indexes over json columns #2469
Conversation
@@ -1806,74 +1806,79 @@ func getCheckAlterableTable(t sql.Table) (sql.CheckAlterableTable, error) { | |||
} | |||
} | |||
|
|||
// generateIndexName generates a unique index name based on the columns in the index, and any existing indexes on the table. | |||
func generateIndexName(ctx *sql.Context, idxAltable sql.IndexAlterableTable, idxColNames []string) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the comment above that this is different than Dolt's implementation is maybe informative to keep?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find the deleted comment, but I think I might've been mistaken before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, all seems reasonable!
This PR consolidates the logic to validate if an index.
Additionally, it fixes a bug where
create table t (i int, index (i, i));
was allowed.fixes: dolthub/dolt#6064