MySQL 9.0.0
Source Code Documentation
|
Record manager wrapper declaration. More...
#include "rem/rec.h"
Go to the source code of this file.
Functions | |
byte * | rec_get_nth_field (const dict_index_t *index, const rec_t *rec, const ulint *offsets, ulint n, ulint *len) |
Gets the value of the specified field in the record. More... | |
const byte * | rec_get_nth_field_old (const dict_index_t *index, const rec_t *rec, ulint n, ulint *len) |
ulint | rec_get_nth_field_size (const dict_index_t *index, const rec_t *rec, ulint n) |
Gets the physical size of an old-style field. More... | |
ulint | rec_get_nth_field_offs (const dict_index_t *index, const ulint *offsets, ulint n, ulint *len) |
The following function is used to get an offset to the nth data field in a record. More... | |
ulint | rec_get_nth_field_offs_old (const dict_index_t *index, const rec_t *rec, ulint n, ulint *len) |
The following function is used to get the offset to the nth data field in an old-style record. More... | |
ulint | rec_offs_nth_extern (const dict_index_t *index, const ulint *offsets, ulint n) |
Returns nonzero if the extern bit is set in nth field of rec. More... | |
void | rec_offs_make_nth_extern (dict_index_t *index, ulint *offsets, ulint n) |
Mark the nth field as externally stored. More... | |
ulint | rec_offs_nth_sql_null (const dict_index_t *index, const ulint *offsets, ulint n) |
Returns nonzero if the SQL NULL bit is set in nth field of rec. More... | |
ulint | rec_offs_nth_default (const dict_index_t *index, const ulint *offsets, ulint n) |
Returns nonzero if the default bit is set in nth field of rec. More... | |
ulint | rec_offs_nth_size (const dict_index_t *index, const ulint *offsets, ulint n) |
Gets the physical size of a field. More... | |
void | rec_set_nth_field (const dict_index_t *index, rec_t *rec, const ulint *offsets, ulint n, const void *data, ulint len) |
This is used to modify the value of an already existing field in a record. More... | |
ulint | rec_2_is_field_extern (const dict_index_t *index, const rec_t *rec, ulint n) |
Returns nonzero if the field is stored off-page. More... | |
ulint | rec_get_data_size_old (const rec_t *rec) |
The following function returns the data size of an old-style physical record, that is the sum of field lengths. More... | |
Record manager wrapper declaration.
Record manager wrapper implementation.
After INSTANT ADD/DROP feature, fields index on logical record might not be same as field index on physical record. So this wrapper is implemented which translates logical index to physical index. And then functions of low level record manager (rem0lrec.h) are called with physical index of the field.
Created 13/08/2021 Mayank Prasad
Created 13/08/2021 Mayank Prasad
ulint rec_2_is_field_extern | ( | const dict_index_t * | index, |
const rec_t * | rec, | ||
ulint | n | ||
) |
Returns nonzero if the field is stored off-page.
[in] | index | index |
[in] | rec | record |
[in] | n | field index |
0 | if the field is stored in-page |
REC_2BYTE_EXTERN_MASK | if the field is stored externally |
The following function returns the data size of an old-style physical record, that is the sum of field lengths.
SQL null fields are counted as length 0 fields. The value returned by the function is the distance from record origin to record end in bytes.
byte * rec_get_nth_field | ( | const dict_index_t * | index, |
const rec_t * | rec, | ||
const ulint * | offsets, | ||
ulint | n, | ||
ulint * | len | ||
) |
Gets the value of the specified field in the record.
[in] | index | record descriptor |
[in] | rec | physical record |
[in] | offsets | array returned by rec_get_offsets() |
[in] | n | index of the field |
[out] | len | length of the field, UNIV_SQL_NULL if SQL null |
ulint rec_get_nth_field_offs | ( | const dict_index_t * | index, |
const ulint * | offsets, | ||
ulint | n, | ||
ulint * | len | ||
) |
The following function is used to get an offset to the nth data field in a record.
[in] | index | record descriptor |
[in] | offsets | array returned by rec_get_offsets() |
[in] | n | index of the field |
[out] | len | length of the field; UNIV_SQL_NULL if SQL null; UNIV_SQL_ADD_COL_DEFAULT if it's default value and no value inlined |
ulint rec_get_nth_field_offs_old | ( | const dict_index_t * | index, |
const rec_t * | rec, | ||
ulint | n, | ||
ulint * | len | ||
) |
The following function is used to get the offset to the nth data field in an old-style record.
[in] | index | record descriptor |
[in] | rec | record |
[in] | n | index of the field |
[in] | len | length of the field;UNIV_SQL_NULL if SQL null |
const byte * rec_get_nth_field_old | ( | const dict_index_t * | index, |
const rec_t * | rec, | ||
ulint | n, | ||
ulint * | len | ||
) |
ulint rec_get_nth_field_size | ( | const dict_index_t * | index, |
const rec_t * | rec, | ||
ulint | n | ||
) |
Gets the physical size of an old-style field.
Also an SQL null may have a field of size > 0, if the data type is of a fixed size.
[in] | index | record descriptor |
[in] | rec | record |
[in] | n | index of the field |
void rec_offs_make_nth_extern | ( | dict_index_t * | index, |
ulint * | offsets, | ||
ulint | n | ||
) |
Mark the nth field as externally stored.
[in] | index | record descriptor |
[in] | offsets | array returned by rec_get_offsets() |
[in] | n | nth field |
ulint rec_offs_nth_default | ( | const dict_index_t * | index, |
const ulint * | offsets, | ||
ulint | n | ||
) |
Returns nonzero if the default bit is set in nth field of rec.
[in] | index | record descriptor |
[in] | offsets | array returned by rec_get_offsets() |
[in] | n | nth field |
ulint rec_offs_nth_extern | ( | const dict_index_t * | index, |
const ulint * | offsets, | ||
ulint | n | ||
) |
Returns nonzero if the extern bit is set in nth field of rec.
[in] | index | record descriptor |
[in] | offsets | array returned by rec_get_offsets() |
[in] | n | nth field |
ulint rec_offs_nth_size | ( | const dict_index_t * | index, |
const ulint * | offsets, | ||
ulint | n | ||
) |
Gets the physical size of a field.
[in] | index | record descriptor |
[in] | offsets | array returned by rec_get_offsets() |
[in] | n | nth field |
ulint rec_offs_nth_sql_null | ( | const dict_index_t * | index, |
const ulint * | offsets, | ||
ulint | n | ||
) |
Returns nonzero if the SQL NULL bit is set in nth field of rec.
[in] | index | record descriptor |
[in] | offsets | array returned by rec_get_offsets() |
[in] | n | nth field |
void rec_set_nth_field | ( | const dict_index_t * | index, |
rec_t * | rec, | ||
const ulint * | offsets, | ||
ulint | n, | ||
const void * | data, | ||
ulint | len | ||
) |
This is used to modify the value of an already existing field in a record.
The previous value must have exactly the same size as the new value. If len is UNIV_SQL_NULL then the field is treated as an SQL null. For records in ROW_FORMAT=COMPACT (new-style records), len must not be UNIV_SQL_NULL unless the field already is SQL null.
[in] | index | record descriptor |
[in] | rec | record |
[in] | offsets | array returned by rec_get_offsets() |
[in] | n | index number of the field |
[in] | len | length of the data or UNIV_SQL_NULL. If not SQL null, must have the same length as the previous value. If SQL null, previous value must be SQL null. |
[in] | data | pointer to the data if not SQL null |