MySQL 9.1.0
Source Code Documentation
|
Record manager. More...
#include "btr0types.h"
#include "dict0boot.h"
#include "dict0dict.h"
#include "mach0data.h"
#include "ut0byte.h"
Functions | |
static void | rec_set_bit_field_1 (rec_t *rec, ulint val, ulint offs, ulint mask, ulint shift) |
Sets a bit field within 1 byte. More... | |
static void | rec_set_bit_field_2 (rec_t *rec, ulint val, ulint offs, ulint mask, ulint shift) |
Sets a bit field within 2 bytes. More... | |
static const rec_t * | rec_get_next_ptr_const (const rec_t *rec, ulint comp) |
static rec_t * | rec_get_next_ptr (rec_t *rec, ulint comp) |
static ulint | rec_get_next_offs (const rec_t *rec, ulint comp) |
static void | rec_set_next_offs_old (rec_t *rec, ulint next) |
The following function is used to set the next record offset field of an old-style record. More... | |
static void | rec_set_next_offs_new (rec_t *rec, ulint next) |
The following function is used to set the next record offset field of a new-style record. More... | |
static void | rec_set_n_fields_old (rec_t *rec, ulint n_fields) |
The following function is used to set the number of fields in an old-style record. More... | |
static ulint | rec_get_n_owned_old (const rec_t *rec) |
The following function is used to get the number of records owned by the previous directory record. More... | |
static void | rec_set_n_owned_old (rec_t *rec, ulint n_owned) |
The following function is used to set the number of owned records. More... | |
static ulint | rec_get_n_owned_new (const rec_t *rec) |
The following function is used to get the number of records owned by the previous directory record. More... | |
static void | rec_set_n_owned_new (rec_t *rec, page_zip_des_t *page_zip, ulint n_owned) |
The following function is used to set the number of owned records. More... | |
static void | rec_set_info_bits_old (rec_t *rec, ulint bits) |
The following function is used to set the info bits of a record. More... | |
static void | rec_set_info_bits_new (rec_t *rec, ulint bits) |
The following function is used to set the info bits of a record. More... | |
static void | rec_set_info_bits_new_temp (rec_t *rec, ulint bits) |
The following function is used to set the info bits of a temp record. More... | |
static void | rec_set_status (rec_t *rec, ulint bits) |
The following function is used to set the status bits of a new-style record. More... | |
static ulint | rec_get_info_and_status_bits (const rec_t *rec, bool comp) |
static void | rec_set_info_and_status_bits (rec_t *rec, ulint bits) |
The following function is used to set the info and status bits of a record. More... | |
static bool | rec_get_deleted_flag (const rec_t *rec, bool comp) |
static void | rec_set_deleted_flag_old (rec_t *rec, bool flag) |
The following function is used to set the deleted bit. More... | |
static void | rec_set_deleted_flag_new (rec_t *rec, page_zip_des_t *page_zip, bool flag) |
The following function is used to set the deleted bit. More... | |
static void | rec_set_instant_flag_new (rec_t *rec, bool flag) |
The following function is used to set the instant bit. More... | |
static void | rec_new_set_versioned (rec_t *rec, bool flag) |
The following function is used to set the version bit. More... | |
static void | rec_new_set_instant (rec_t *rec) |
static void | rec_new_set_versioned (rec_t *rec) |
static void | rec_new_reset_instant_version (rec_t *rec) |
static void | rec_old_set_versioned (rec_t *rec, bool flag) |
The following function is used to set the version bit. More... | |
static void | rec_new_temp_set_versioned (rec_t *rec, bool flag) |
The following function is used to set the version bit. More... | |
static bool | rec_get_node_ptr_flag (const rec_t *rec) |
The following function tells if a new-style record is a node pointer. More... | |
static uint16_t | rec_get_heap_no_old (const rec_t *rec) |
The following function is used to get the order number of an old-style record in the heap of the index page. More... | |
static void | rec_set_heap_no_old (rec_t *rec, ulint heap_no) |
The following function is used to set the heap number field in an old-style record. More... | |
static uint16_t | rec_get_heap_no_new (const rec_t *rec) |
The following function is used to get the order number of a new-style record in the heap of the index page. More... | |
static void | rec_set_heap_no_new (rec_t *rec, ulint heap_no) |
The following function is used to set the heap number field in a new-style record. More... | |
static void | rec_set_1byte_offs_flag (rec_t *rec, bool flag) |
The following function is used to set the 1-byte offsets flag. More... | |
static bool | rec_field_not_null_not_add_col_def (ulint len) |
Determine if the field is not NULL and not having default value after instant ADD COLUMN. More... | |
static bool | rec_offs_comp (const ulint *offsets) |
Determine if the offsets are for a record in the new compact format. More... | |
static bool | rec_offs_any_extern (const ulint *offsets) |
Determine if the offsets are for a record containing externally stored columns. More... | |
static const byte * | rec_offs_any_null_extern (const dict_index_t *index, const rec_t *rec, const ulint *offsets) |
static ulint | rec_offs_n_extern (const dict_index_t *index, const ulint *offsets) |
Returns the number of extern bits set in a record. More... | |
static ulint | rec_1_get_prev_field_end_info (const rec_t *rec, ulint n) |
Returns the offset of n - 1th field end if the record is stored in the 1-byte offsets form. More... | |
static ulint | rec_2_get_prev_field_end_info (const rec_t *rec, ulint n) |
Returns the offset of n - 1th field end if the record is stored in the 2-byte offsets form. More... | |
static ulint | rec_offs_data_size (const ulint *offsets) |
The following function returns the data size of a physical record, that is the sum of field lengths. More... | |
static ulint | rec_offs_extra_size (const ulint *offsets) |
Returns the total size of record minus data size of record. More... | |
static ulint | rec_offs_size (const ulint *offsets) |
Returns the total size of a physical record. More... | |
static byte * | rec_get_end (const rec_t *rec, const ulint *offsets) |
static byte * | rec_get_start (const rec_t *rec, const ulint *offsets) |
static rec_t * | rec_copy (void *buf, const rec_t *rec, const ulint *offsets) |
Copy a physical record to a buffer. More... | |
static ulint | rec_get_converted_extra_size (ulint data_size, ulint n_fields, bool has_ext) |
Returns the extra size of an old-style physical record if we know its data size and number of fields. More... | |
static ulint | rec_get_converted_size (const dict_index_t *index, const dtuple_t *dtuple) |
The following function returns the size of a data tuple when converted to a physical record. More... | |
static uint64_t | rec_hash (const rec_t *rec, const ulint *offsets, ulint n_fields, ulint n_bytes, uint64_t hash_value, const dict_index_t *index) |
Compute a hash value of a prefix of a leaf page record. More... | |
static uint8_t | rec_get_n_fields_length (ulint n_fields) |
Get the length of the number of fields for any new style record. More... | |
static uint8_t | rec_set_n_fields (rec_t *rec, ulint n_fields) |
Set the number of fields for one new style leaf page record. More... | |
static void | rec_set_instant_row_version_new (rec_t *rec, row_version_t row_version) |
Set the row version on a new style leaf page record. More... | |
static row_version_t | rec_get_instant_row_version_new (const rec_t *rec) |
Get the row version on a new style leaf page record. More... | |
static void | rec_set_instant_row_version_old (rec_t *rec, row_version_t row_version) |
Set the row version on an old style leaf page record. More... | |
static row_version_t | rec_get_instant_row_version_old (const rec_t *rec) |
Get the row version on an old style leaf page record. More... | |
static const byte * | rec_get_nth_field_old_instant (const rec_t *rec, uint16_t n, const dict_index_t *index, ulint *len) |
Gets the value of the specified field in the record in old style. More... | |
static const byte * | rec_get_nth_field_instant (const rec_t *rec, const ulint *offsets, ulint n, const dict_index_t *index, ulint *len) |
Gets the value of the specified field in the record. More... | |
static bool | rec_is_min_rec_flag_set (const rec_t *rec, bool is_comp) |
Record manager.
Created 5/30/1994 Heikki Tuuri
Returns the offset of n - 1th 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. This function and the 2-byte counterpart are defined here because the C-compiler was not able to sum negative and positive constant offsets, and warned of constant arithmetic overflow within the compiler.
rec | in: record |
n | in: field index |
Returns the offset of n - 1th 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.
rec | in: record |
n | in: field index |
Copy a physical record to a buffer.
[in] | buf | buffer |
[in] | rec | physical record |
[in] | offsets | array returned by rec_get_offsets() |
|
inlinestatic |
Determine if the field is not NULL and not having default value after instant ADD COLUMN.
[in] | len | length of a field |
|
inlinestatic |
Returns the extra size of an old-style physical record if we know its data size and number of fields.
|
inlinestatic |
The following function returns the size of a data tuple when converted to a physical record.
[in] | index | record descriptor |
[in] | dtuple | data tuple |
|
inlinestatic |
|
inlinestatic |
The following function is used to get the order number of a new-style record in the heap of the index page.
rec | in: physical record |
|
inlinestatic |
The following function is used to get the order number of an old-style record in the heap of the index page.
rec | in: physical record |
|
inlinestatic |
Get the row version on a new style leaf page record.
This is only needed for table after instant ADD/DROP COLUMN.
[in] | rec | leaf page record |
|
inlinestatic |
Get the row version on an old style leaf page record.
This is only needed for table after instant ADD/DROP COLUMN.
[in] | rec | leaf page record |
|
inlinestatic |
Get the length of the number of fields for any new style record.
[in] | n_fields | number of fields in the record |
The following function is used to get the number of records owned by the previous directory record.
rec | in: new-style physical record |
The following function is used to get the number of records owned by the previous directory record.
rec | in: old-style physical record |
Check if the result offset is still on the same page. We allow field_value
to be interpreted as negative 16bit integer. This check does nothing for 64KB pages.
Check if the result offset is still on the same page. We allow field_value
to be interpreted as negative 16bit integer. This check does nothing for 64KB pages.
|
inlinestatic |
The following function tells if a new-style record is a node pointer.
rec | in: physical record |
|
inlinestatic |
Gets the value of the specified field in the record.
This is only used when there is possibility that the record comes from the clustered index, which has some instantly add columns
[in] | rec | record |
[in] | offsets | array returned by rec_get_offsets() |
[in] | n | index of the field |
[in] | index | clustered index where the record resides |
[in,out] | len | length of the field, UNIV_SQL_NULL if SQL null |
|
inlinestatic |
Gets the value of the specified field in the record in old style.
This is only used for record from instant index, which is clustered index and has some instantly added columns.
[in] | rec | physical record |
[in] | n | index of the field |
[in] | index | clustered index where the record resides |
[out] | len | length of the field, UNIV_SQL if SQL null |
|
inlinestatic |
Compute a hash value of a prefix of a leaf page record.
[in] | rec | leaf page record |
[in] | offsets | rec_get_offsets(rec) |
[in] | n_fields | number of complete fields to hash |
[in] | n_bytes | number of bytes to hash in the last field |
[in] | hash_value | hash value of the index identifier |
[in] | index | index where the record resides |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
The following function is used to set the version bit.
[in,out] | rec | new-style (COMPACT/DYNAMIC) physical record |
[in] | flag | set the bit to this flag |
|
inlinestatic |
The following function is used to set the version bit.
[in,out] | rec | Temp physical record |
[in] | flag | true to set, false to reset |
|
inlinestatic |
Determine if the offsets are for a record containing externally stored columns.
offsets | in: array returned by rec_get_offsets() |
|
inlinestatic |
|
inlinestatic |
Determine if the offsets are for a record in the new compact format.
offsets | in: array returned by rec_get_offsets() |
The following function returns the data size of a 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.
offsets | in: array returned by rec_get_offsets() |
Returns the total size of record minus data size of record.
The value returned by the function is the distance from record start to record origin in bytes.
offsets | in: array returned by rec_get_offsets() |
|
inlinestatic |
Returns the number of extern bits set in a record.
[in] | index | record descriptor |
[in] | offsets | array returned by rec_get_offsets() |
Returns the total size of a physical record.
offsets | in: array returned by rec_get_offsets() |
|
inlinestatic |
The following function is used to set the version bit.
[in,out] | rec | old-style (REDUNDANT) physical record |
[in] | flag | true to set, false to reset |
|
inlinestatic |
The following function is used to set the 1-byte offsets flag.
rec | in: physical record |
flag | in: true if 1byte form |
|
inlinestatic |
Sets a bit field within 1 byte.
rec | in: pointer to record origin |
val | in: value to set |
offs | in: offset from the origin down |
mask | in: mask used to filter bits |
shift | in: shift right applied after masking |
|
inlinestatic |
Sets a bit field within 2 bytes.
rec | in: pointer to record origin |
val | in: value to set |
offs | in: offset from the origin down |
mask | in: mask used to filter bits |
shift | in: shift right applied after masking |
|
inlinestatic |
The following function is used to set the deleted bit.
rec | in/out: new-style physical record |
page_zip | in/out: compressed page, or NULL |
flag | in: nonzero if delete marked |
|
inlinestatic |
The following function is used to set the deleted bit.
rec | in: old-style physical record |
flag | in: nonzero if delete marked |
The following function is used to set the heap number field in a new-style record.
rec | in/out: physical record |
heap_no | in: the heap number |
The following function is used to set the heap number field in an old-style record.
rec | in: physical record |
heap_no | in: the heap number |
The following function is used to set the info and status bits of a record.
(Only compact records have status bits.)
rec | in/out: physical record |
bits | in: info bits |
The following function is used to set the info bits of a record.
rec | in/out: new-style physical record |
bits | in: info bits |
The following function is used to set the info bits of a temp record.
param[in,out] rec temp physical record param[in] bits info bits
The following function is used to set the info bits of a record.
rec | in: old-style physical record |
bits | in: info bits |
|
inlinestatic |
The following function is used to set the instant bit.
[in,out] | rec | new-style physical record |
[in] | flag | set the bit to this flag |
|
inlinestatic |
Set the row version on a new style leaf page record.
This is only needed for table after instant ADD/DROP COLUMN.
[in,out] | rec | leaf page record |
[in] | row_version | row version |
|
inlinestatic |
Set the row version on an old style leaf page record.
This is only needed for table after instant ADD/DROP COLUMN.
[in,out] | rec | leaf page record |
[in] | row_version | row version |
Set the number of fields for one new style leaf page record.
This is only needed for table after instant ADD COLUMN.
[in,out] | rec | leaf page record |
[in] | n_fields | number of fields in the record |
The following function is used to set the number of fields in an old-style record.
rec | in: physical record |
n_fields | in: the number of fields |
|
inlinestatic |
The following function is used to set the number of owned records.
rec | in/out: new-style physical record |
page_zip | in/out: compressed page, or NULL |
n_owned | in: the number of owned |
The following function is used to set the number of owned records.
rec | in: old-style physical record |
n_owned | in: the number of owned |
The following function is used to set the next record offset field of a new-style record.
rec | in/out: new-style physical record |
next | in: offset of the next record |
The following function is used to set the next record offset field of an old-style record.
rec | in: old-style physical record |
next | in: offset of the next record |