diff --git a/tableparser/tableparser.go b/tableparser/tableparser.go index 53f371c..13a4bbc 100644 --- a/tableparser/tableparser.go +++ b/tableparser/tableparser.go @@ -71,6 +71,7 @@ type IndexField struct { Visible string // MySQL 8.0+ Expression sql.NullString // MySQL 8.0.16+ Clustered string // TiDB Support + Global string // TiDB Support } // Constraint holds Foreign Keys information @@ -302,6 +303,10 @@ func getIndexes(db *sql.DB, schema, tableName string) (map[string]Index, error) if err == nil && len(cols) >= 16 && cols[15] == "Clustered" { fields = append(fields, &i.Clustered) } + // support for TiDB (Global Index) + if err == nil && len(cols) >= 17 && cols[16] == "Global" { + fields = append(fields, &i.Global) + } err = rows.Scan(fields...) if err != nil {