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
ddl: Add lower limit of length of index column type #3864
Conversation
@@ -49,6 +49,10 @@ func buildIndexColumns(columns []*model.ColumnInfo, idxColNames []*ast.IndexColN | |||
return nil, errKeyColumnDoesNotExits.Gen("column does not exist: %s", ic.Column.Name) | |||
} | |||
|
|||
if col.Flen == 0 { |
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.
We should check this in plan/validator.go.
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.
How to check table column type length in create index
grammar?
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.
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.
You can check the Flen in this function:https://github.com/pingcap/tidb/blob/master/plan/validator.go#L259
Refer to this as an example.
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.
A statement as create index idx on t (i)
will not pass table column type, it is not the same case of create table
statement.
LGTM |
@tiancaiamao @zimulala PTAL |
LGTM |
Fix issue #3833 . @zimulala @hicqu PTAL