| 213 | } |
| 214 | |
| 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 |
| 245 | } |
| 246 | |
| 247 | // FieldNames returns an string array with the table's field names |
| 248 | func (t *Table) FieldNames() []string { |