MySQL 8.0.39
Source Code Documentation
Column Definition

if CLIENT_PROTOCOL_41 is set Protocol::ColumnDefinition41: is used, Protocol::ColumnDefinition320:

Protocol::ColumnDefinition41:

Payload
TypeNameDescription
string<lenenc> catalog The catalog used. Currently always "def"
string<lenenc> schema schema name
string<lenenc> table virtual table name
string<lenenc> org_table physical table name
string<lenenc> name virtual column name
string<lenenc> org_name physical column name
int<lenenc> length of fixed length fields [0x0c]
int<2> character_set the column character set as defined in Character Set
int<4> column_length maximum length of the field
int<1> type type of the column as defined in enum_field_types
int<2> flags Flags as defined in Column Definition Flags
int<1> decimals max shown decimal digits:
  • 0x00 for integers and static strings
  • 0x1f for dynamic strings, double, float
  • 0x00 to 0x51 for decimals
Note
decimals and column_length can be used for text output formatting

Protocol::ColumnDefinition320:

Payload
TypeNameDescription
string<lenenc> table Table name
string<lenenc> name Column name
int<lenenc> length of type field [01]
int<1> type type of the column as defined in enum_field_types
if capabilities & CLIENT_LONG_FLAG {
int<lenenc> length of flags + decimals fields [03]
int<2> flags Flags as defined in Column Definition Flags
int<1> decimals number of decimal digits
} else {
int<lenenc> length of flags + decimals fields [02]
int<2> flags Flags as defined in Column Definition Flags
int<1> decimals number of decimal digits
}
if command was COM_FIELD_LIST {
int<lenenc> length of default values [02]
string<lenenc> default_values
}
See also
Protocol_classic::send_field_metadata