From 9f1dcbebd3fd84b182a62b03fee8493cc14b8210 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Thu, 22 May 2025 18:56:07 +0200 Subject: [PATCH] Accept TiDB Global Index column --- tableparser/tableparser.go | 5 +++++ 1 file changed, 5 insertions(+) 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 {