Merge pull request #949 from c-wind/master
ddl:Delete the useless judgment
This commit is contained in:
@ -29,12 +29,6 @@ import (
|
||||
)
|
||||
|
||||
func buildIndexInfo(tblInfo *model.TableInfo, unique bool, indexName model.CIStr, indexID int64, idxColNames []*coldef.IndexColName) (*model.IndexInfo, error) {
|
||||
for _, col := range tblInfo.Columns {
|
||||
if col.Name.L == indexName.L {
|
||||
return nil, errors.Errorf("CREATE INDEX: index name collision with existing column: %s", indexName)
|
||||
}
|
||||
}
|
||||
|
||||
// build offsets
|
||||
idxColumns := make([]*model.IndexColumn, 0, len(idxColNames))
|
||||
for _, ic := range idxColNames {
|
||||
|
||||
@ -612,6 +612,9 @@ func (s *testIndexSuite) TestAddIndex(c *C) {
|
||||
job := testCreateIndex(c, ctx, d, s.dbInfo, tblInfo, true, "c1_uni", "c1")
|
||||
testCheckJobDone(c, d, job, true)
|
||||
|
||||
job = testCreateIndex(c, ctx, d, s.dbInfo, tblInfo, true, "c1", "c1")
|
||||
testCheckJobDone(c, d, job, true)
|
||||
|
||||
_, err = ctx.GetTxn(true)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user