From 82f124afec65b98a4008a98246544926eb34496e Mon Sep 17 00:00:00 2001 From: Jerry <85411418@qq.com> Date: Tue, 10 Mar 2020 20:43:15 +0800 Subject: [PATCH] fix bug about index.Cols --- engine.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/engine.go b/engine.go index 6dd4df3e..630dc368 100644 --- a/engine.go +++ b/engine.go @@ -286,13 +286,7 @@ func (engine *Engine) loadTableInfo(table *schemas.Table) error { var seq int for _, index := range indexes { for _, name := range index.Cols { - parts := strings.Split(name, " ") - if len(parts) > 1 { - if parts[1] == "DESC" { - seq = 1 - } - } - if col := table.GetColumn(parts[0]); col != nil { + if col := table.GetColumn(name); col != nil { col.Indexes[index.Name] = index.Type } else { return fmt.Errorf("Unknown col %s seq %d, in index %v of table %v, columns %v", name, seq, index.Name, table.Name, table.ColumnsSeq())