MySQL 8.3.0
Source Code Documentation
String Types

Strings are sequences of bytes and appear in a few forms in the protocol.

Protocol::FixedLengthString

Fixed-length strings have a known, hardcoded length.

An example is the sql-state of the ERR_Packet which is always 5 bytes long.

Protocol::NullTerminatedString

Strings that are terminated by a 00 byte.

Protocol::VariableLengthString

The length of the string is determined by another field or is calculated at runtime

Protocol::LengthEncodedString

A length encoded string is a string that is prefixed with length encoded integer describing the length of the string.

It is a special case of Protocol::VariableLengthString

Protocol::RestOfPacketString

If a string is the last component of a packet, its length can be calculated from the overall packet length minus the current position.