MySQL 8.4.2
Source Code Documentation
|
Record manager. More...
#include "rem0rec.h"
Go to the source code of this file.
Functions | |
static void | rec_set_nth_field_sql_null_low (rec_t *rec, ulint n) |
Set nth field value to SQL NULL. More... | |
static ulint | rec_offs_nth_sql_null_low (const ulint *offsets, ulint n) |
Returns nonzero if the SQL NULL bit is set in nth field of rec. More... | |
static ulint | rec_get_field_start_offs_low (const rec_t *rec, ulint n) |
Read the offset of the start of a data field in the record. More... | |
static ulint | rec_1_get_field_start_offs_low (const rec_t *rec, ulint n) |
Returns the offset of nth field start if the record is stored in the 1-byte offsets form. More... | |
static ulint | rec_1_get_field_end_info_low (const rec_t *rec, ulint n) |
Returns the offset of nth field end if the record is stored in the 1-byte offsets form. More... | |
static void | rec_1_set_field_end_info_low (rec_t *rec, ulint n, ulint info) |
Sets the field end info for the nth field if the record is stored in the 1-byte format. More... | |
static ulint | rec_2_get_field_start_offs_low (const rec_t *rec, ulint n) |
Returns the offset of nth field start if the record is stored in the 2-byte offsets form. More... | |
static ulint | rec_2_get_field_end_info_low (const rec_t *rec, ulint n) |
Returns the offset of nth field end if the record is stored in the 2-byte offsets form. More... | |
static void | rec_2_set_field_end_info_low (rec_t *rec, ulint n, ulint info) |
Sets the field end info for the nth field if the record is stored in the 2-byte format. More... | |
static void | rec_set_nth_field_null_bit_low (rec_t *rec, ulint i, bool val) |
Sets the value of the ith field SQL null bit of an old-style record. More... | |
static ulint | rec_get_nth_field_size_low (const rec_t *rec, ulint n) |
Gets the physical size of an old-style field. More... | |
static ulint | rec_get_nth_field_offs_low (const ulint *offsets, ulint n, ulint *len) |
Get an offset to the nth data field in a record. More... | |
static ulint | rec_get_nth_field_offs_old_low (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... | |
static ulint | rec_offs_nth_extern_low (const ulint *offsets, ulint n) |
Returns nonzero if the extern bit is set in nth field of rec. More... | |
static void | rec_offs_make_nth_extern_low (ulint *offsets, const ulint n) |
Mark the nth field as externally stored. More... | |
static ulint | rec_offs_nth_default_low (const ulint *offsets, ulint n) |
Returns nonzero if the default bit is set in nth field of rec. More... | |
static ulint | rec_offs_nth_size_low (const ulint *offsets, ulint n) |
Gets the physical size of a field. More... | |
static void | rec_set_nth_field_low (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... | |
Record manager.
This file contains low level functions which deals with physical index of fields in a physical record.
After INSTANT ADD/DROP feature, fields index on logical record might not be same as field index on physical record. So a wrapper (rem0wrec.h) is implemented which translates logical index to physical index. And then functions of this file are called with physical index of the field.
Created 13/08/2021 Mayank Prasad
Returns the offset of nth field end if the record is stored in the 1-byte offsets form.
If the field is SQL null, the flag is ORed in the returned value.
[in] | rec | record |
[in] | n | index of the field |
Returns the offset of nth field start if the record is stored in the 1-byte offsets form.
[in] | rec | record |
[in] | n | index of the field |
Sets the field end info for the nth field if the record is stored in the 1-byte format.
[in,out] | rec | record |
[in] | n | index of the field |
[in] | info | value to set |
Returns the offset of nth field end if the record is stored in the 2-byte offsets form.
If the field is SQL null, the flag is ORed in the returned value.
[in] | rec | record |
[in] | n | index of the field |
Returns the offset of nth field start if the record is stored in the 2-byte offsets form.
[in] | rec | record |
[in] | n | index of the field |
Sets the field end info for the nth field if the record is stored in the 2-byte format.
[in] | rec | record |
[in] | n | index of the field |
[out] | info | end info |
Read the offset of the start of a data field in the record.
The start of an SQL null field is the end offset of the previous non-null field, or 0, if none exists. If n is the number of the last field + 1, then the end offset of the last field is returned.
[in] | rec | record |
[in] | n | index of the field |
|
inlinestatic |
Get an offset to the nth data field in a 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; UNIV_SQL_ADD_COL_DEFAULT if it's default value and no value inlined |
|
inlinestatic |
The following function is used to get the offset to the nth data field in an old-style record.
[in] | rec | record |
[in] | n | index of the field |
[out] | len | length of the field; UNIV_SQL_NULL if SQL null; |
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] | rec | record |
[in] | n | index of the field |
Mark the nth field as externally stored.
[in] | offsets | array returned by rec_get_offsets() |
[in] | n | index of the field |
Returns nonzero if the default bit is set in nth field of rec.
[in] | offsets | array returned by rec_get_offsets() |
[in] | n | index of the field |
Returns nonzero if the extern bit is set in nth field of rec.
[in] | offsets | array returned by rec_get_offsets() |
[in] | n | index of the field |
Gets the physical size of a field.
[in] | offsets | array returned by rec_get_offsets() |
[in] | n | index of the field |
Returns nonzero if the SQL NULL bit is set in nth field of rec.
[in] | offsets | array returned by rec_get_offsets() |
[in] | n | index of the field. |
|
inlinestatic |
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] | rec | record |
[in] | offsets | array returned by rec_get_offsets() |
[in] | n | index of the field |
[in] | data | pointer to the data if not SQL null |
[in] | len | length of the data or UNIV_SQL_NULL |
Sets the value of the ith field SQL null bit of an old-style record.
[in] | rec | record |
[in] | i | index of the field |
[in] | val | value to set |