MCPcopy Create free account
hub / github.com/Percona-Lab/mysql_random_data_load / makeScanRecipients

Function makeScanRecipients

tableparser/tableparser.go:215–245  ·  view source on GitHub ↗
(f *Field, allowNull *string, cols []string)

Source from the content-addressed store, hash-verified

213}
214
215func 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
248func (t *Table) FieldNames() []string {

Callers 1

parseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected