Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tableparser/tableparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down