Documentation Home
MySQL Internals Manual


14.1.1.2 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.

Implemented By

string<fix>

Protocol::NulTerminatedString

Strings that are terminated by a [00] byte.

Implemented By

string<NUL>

Protocol::VariableLengthString:

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

Implemented By

string<var>

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

Fields
Implemented By

string<lenenc>

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.

Implemented By

string<EOF>


User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.