MySQL 8.4.2
Source Code Documentation
|
A Text Resultset is a possible COM_QUERY Response.
It is made up of 2 parts:
The column definitions part starts with a packet containing the column-count, followed by as many Column Definition packets as there are columns and terminated by a EOF_Packet if the CLIENT_DEPRECATE_EOF is not set.
Each row is a packet, too. The rows are terminated by another EOF_Packet. In case the query could generate the Column Definition set, but generating the rows afterwards failed, a ERR_Packet may be sent instead of the last EOF_Packet.
Type | Name | Description |
---|---|---|
if capabilities & CLIENT_OPTIONAL_RESULTSET_METADATA { | ||
int<1> | metadata_follows | Flag specifying if metadata are skipped or not. See enum_resultset_metadata |
} | ||
int<lenenc> | column_count | Number of Column Definition to follow |
if (not (capabilities & CLIENT_OPTIONAL_RESULTSET_METADATA)) or metadata_follows == RESULTSET_METADATA_FULL { | ||
column_count x Column Definition | Field metadata | one Column Definition for each field up to column_count |
} | ||
if (not capabilities & CLIENT_DEPRECATE_EOF) { | ||
EOF_Packet | End of metadata | Marker to set the end of metadata |
} | ||
One or more Text Resultset Row | The row data | each Text Resultset Row contains column_count values |
if (error processing) { | ||
ERR_Packet | terminator | Error details |
} else if capabilities & CLIENT_DEPRECATE_EOF { | ||
OK_Packet | terminator | All the execution details |
} else { | ||
EOF_Packet | terminator | end of resultset marker |
} |
If the SERVER_MORE_RESULTS_EXISTS flag is set in the last EOF_Packet / OK_Packet, another Text Resultset will follow. See Multi-resultset.