/** The following function is used to fetch data from one byte. @param[in]bpointertoabytetoread
@return ulint integer, >= 0, < 256 */ staticinline uchar mach_read_from_1(const uchar *b)
{ return ((uchar) (b[0]));
}
/** Reads a ulint stored in the little-endian format.
@return unsigned long int */ staticinline ulong
mach_read_from_2_little_endian(const uchar *buf) /*!< in: from where to read */
{ return ((ulong) (buf[0]) | ((ulong) (buf[1]) << 8));
}
/** Reads a ulint stored in the little-endian format. @param[in]bufFromwheretoread. @param[in]buf_sizeFromhowmanybytestoread.
@return unsigned long int */ staticinline ulong mach_read_from_n_little_endian(const uchar *buf,
ulong buf_size)
{
ulong n= 0; const uchar *ptr;
ptr= buf + buf_size;
for (;;)
{
ptr--;
n= n << 8;
n+= (ulong) (*ptr);
if (ptr == buf)
{ break;
}
}
return (n);
}
/** Reads a >= 5.0.3 format true VARCHAR length, in the MySQL row format, and returnsapointertothedata. @returnpointertothedata,weskipthe1or2bytesatthestart
that are used to store the len */ staticinlineconst uchar *row_mysql_read_true_varchar(
ulong *len, /*!< out: variable-length field length */ const uchar *field, /*!< in: field in the MySQL format */
ulong lenlen) /*!< in: storage length of len: either 1
or 2 bytes */
{ if (lenlen == 2)
{
*len= mach_read_from_2_little_endian(field);
return (field + 2);
}
*len= mach_read_from_1(field);
return (field + 1);
}
/** Reads a reference to a BLOB in the MySQL format. @param[out]lenBLOBlength. @param[in]refBLOBreferenceintheMySQLformat. @param[in]col_lenBLOBreferencelength(notBLOBlength).
@return pointer to BLOB data */ staticinlineconst uchar *
row_mysql_read_blob_ref(ulong *len, const uchar *ref, ulong col_len)
{
uchar *data;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.