MySQL  8.0.16
Source Code Documentation
String Types

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


Fixed-length strings have a known, hardcoded length.

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


Strings that are terminated by a 00 byte.


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


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


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