Skip to main content

read_varlen_uint

Function read_varlen_uint 

Source
pub fn read_varlen_uint(buf: &mut ParseBuf<'_>) -> Result<u64>
Expand description

Reads a variable-length unsigned integer from the MySQL serialization format.

§Encoding

Bytes are stored in little-endian order. The least-significant byte’s trailing 1-bits encode the total byte count: count = trailing_ones + 1.

For 1–8 bytes, the encoded value is: le_uint >> (trailing_ones + 1). For 9 bytes (first byte = 0xFF), the remaining 8 bytes are the raw value.

§Reference

https://dev.mysql.com/doc/dev/mysql-server/latest/PageLibsMysqlSerialization.html