@@ -47,11 +47,11 @@ type Table struct {
47
47
48
48
// Index holds the basic index information
49
49
type Index struct {
50
- Name string
51
- Fields []string
52
- Unique bool
53
- Visible bool
54
- Expression string // MySQL 8.0.16+
50
+ Name string
51
+ Fields []string
52
+ Unique bool
53
+ Visible bool
54
+ Expression string // MySQL 8.0.16+
55
55
}
56
56
57
57
// IndexField holds raw index information as defined in INFORMATION_SCHEMA table
@@ -68,7 +68,7 @@ type IndexField struct {
68
68
Comment string
69
69
IndexComment string
70
70
NonUnique bool
71
- Visible string // MySQL 8.0+
71
+ Visible string // MySQL 8.0+
72
72
Expression sql.NullString // MySQL 8.0.16+
73
73
}
74
74
@@ -213,35 +213,35 @@ func (t *Table) parse() error {
213
213
}
214
214
215
215
func makeScanRecipients (f * Field , allowNull * string , cols []string ) []interface {} {
216
- fields := []interface {}{
217
- & f .TableCatalog ,
218
- & f .TableSchema ,
219
- & f .TableName ,
220
- & f .ColumnName ,
221
- & f .OrdinalPosition ,
222
- & f .ColumnDefault ,
223
- & allowNull ,
224
- & f .DataType ,
225
- & f .CharacterMaximumLength ,
226
- & f .CharacterOctetLength ,
227
- & f .NumericPrecision ,
228
- & f .NumericScale ,
229
- }
230
-
231
- if len (cols ) > 19 { // MySQL 5.5 does not have "DATETIME_PRECISION" field
232
- fields = append (fields , & f .DatetimePrecision )
233
- }
234
-
235
- fields = append (fields , & f .CharacterSetName , & f .CollationName , & f .ColumnType , & f .ColumnKey , & f .Extra , & f .Privileges , & f .ColumnComment )
236
-
237
- if len (cols ) > 20 && cols [20 ] == "GENERATION_EXPRESSION" { // MySQL 5.7+ "GENERATION_EXPRESSION" field
238
- fields = append (fields , & f .GenerationExpression )
239
- }
240
- if len (cols ) > 21 && cols [21 ] == "SRS_ID" { // MySQL 8.0+ "SRS ID" field
241
- fields = append (fields , & f .SrsID )
242
- }
243
-
244
- return fields
216
+ fields := []interface {}{
217
+ & f .TableCatalog ,
218
+ & f .TableSchema ,
219
+ & f .TableName ,
220
+ & f .ColumnName ,
221
+ & f .OrdinalPosition ,
222
+ & f .ColumnDefault ,
223
+ & allowNull ,
224
+ & f .DataType ,
225
+ & f .CharacterMaximumLength ,
226
+ & f .CharacterOctetLength ,
227
+ & f .NumericPrecision ,
228
+ & f .NumericScale ,
229
+ }
230
+
231
+ if len (cols ) > 19 { // MySQL 5.5 does not have "DATETIME_PRECISION" field
232
+ fields = append (fields , & f .DatetimePrecision )
233
+ }
234
+
235
+ fields = append (fields , & f .CharacterSetName , & f .CollationName , & f .ColumnType , & f .ColumnKey , & f .Extra , & f .Privileges , & f .ColumnComment )
236
+
237
+ if len (cols ) > 20 && cols [20 ] == "GENERATION_EXPRESSION" { // MySQL 5.7+ "GENERATION_EXPRESSION" field
238
+ fields = append (fields , & f .GenerationExpression )
239
+ }
240
+ if len (cols ) > 21 && cols [21 ] == "SRS_ID" { // MySQL 8.0+ "SRS ID" field
241
+ fields = append (fields , & f .SrsID )
242
+ }
243
+
244
+ return fields
245
245
}
246
246
247
247
// FieldNames returns an string array with the table's field names
@@ -264,7 +264,7 @@ func getIndexes(db *sql.DB, schema, tableName string) (map[string]Index, error)
264
264
265
265
for rows .Next () {
266
266
var i IndexField
267
- var table , string
267
+ var table , visible string
268
268
fields := []interface {}{& table , & i .NonUnique , & i .KeyName , & i .SeqInIndex ,
269
269
& i .ColumnName , & i .Collation , & i .Cardinality , & i .SubPart ,
270
270
& i .Packed , & i .Null , & i .IndexType , & i .Comment , & i .IndexComment ,
0 commit comments