Read bytes stored in a row into a pre-allocated buffer.
The raw bytes are as received from the server. In genral the value is represented using x-protocol encoding that corresponds to the type and other meta-data of the given column. This information can be obtained from mysqlx_column_get_type()
and other mysqlx_column_get_*()
functions.
The x-protocol represenation of different value types is documented here. Most types in the mysqlx_data_type_t enumeration correspond to an x-protocol value type of the same name.
STRING values are encoded using the character set encoding as reported by mysqlx_column_get_collation() function.
JSON data is represented as a JSON string. ENUM values are represented as strings with enum constant names. Values of type TIMESTAMP use the same representation as DATETIME. GEOMETRY values use the internal geometry storage format described here.
Types BOOL and EXPR are never reported for data received from server – they are used when sending data to the server.
Note that raw representation of BYTES and STRING values has an extra 0x00 byte added at the end, which is not part of the originial data. It is used to distinguish null values from empty byte sequences.
- Parameters
-
| row | row handle |
| col | zero-based column number |
| offset | the number of bytes to skip before reading them from source row |
[out] | buf | the buffer allocated on the user side into which to write data |
[in,out] | buf_len | pointer to a variable holding the length of the buffer [IN], the number of bytes actually written into the buffer [OUT] |
- Returns
RESULT_OK
- on success; RESULT_NULL
when the value in the requested column is NULL; RESULT_MORE_DATA
if not all data was fetched after the last call to the function; RESULT_ERROR
- on error