Merge pull request #949 from c-wind/master

ddl:Delete the useless judgment
This commit is contained in:
Ewan Chou
2016-03-04 14:33:36 +08:00
2 changed files with 3 additions and 6 deletions

View File

@ -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 {

View File

@ -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)