MySQL 8.4.2
Source Code Documentation
|
The struct 'lob::ref_t' represents an external field reference. More...
#include <lob0lob.h>
Public Member Functions | |
ref_t (byte *ptr) | |
Constructor. More... | |
bool | use_single_z_stream () const |
For compressed LOB, if the length is less than or equal to Z_CHUNK_SIZE then use the older single z stream format to store the LOB. More... | |
bool | is_big (const page_size_t &page_size) const |
Check if this LOB is big enough to do partial update. More... | |
void | parse (ref_mem_t &obj) const |
Parse the LOB reference object and copy data into the given ref_mem_t object. More... | |
void | copy (byte *field_ref) const |
Copy the LOB reference into the given memory location. More... | |
bool | is_equal (const byte *ptr) const |
Check whether the stored external field reference is equal to the given field reference. More... | |
void | set_ref (byte *ptr) |
Set the external field reference to the given memory location. More... | |
bool | is_null_relaxed () const |
Check if the field reference is made of zeroes except the being_modified bit. More... | |
bool | is_null () const |
Check if the field reference is made of zeroes. More... | |
void | set_owner (bool owner, mtr_t *mtr) |
Set the ownership flag in the blob reference. More... | |
void | set_being_modified (bool modifying, mtr_t *mtr) |
Set the being_modified flag in the field reference. More... | |
bool | is_being_modified () const |
Check if the current blob is being modified. More... | |
void | set_inherited (bool inherited, mtr_t *mtr) |
Set the inherited flag in the field reference. More... | |
bool | is_owner () const |
Check if the current row is the owner of the blob. More... | |
bool | is_inherited () const |
Check if the current row inherited the blob from parent row. More... | |
space_id_t | space_id () const |
Read the space id from the blob reference. More... | |
page_no_t | page_no () const |
Read the page number from the blob reference. More... | |
ulint | offset () const |
Read the offset of blob header from the blob reference. More... | |
uint32_t | version () const |
Read the LOB version from the blob reference. More... | |
ulint | length () const |
Read the length from the blob reference. More... | |
void | update (space_id_t space_id, ulint page_no, ulint offset, mtr_t *mtr) |
Update the information stored in the external field reference. More... | |
void | set_space_id (const space_id_t space_id, mtr_t *mtr) |
Set the space_id in the external field reference. More... | |
void | set_page_no (const ulint page_no, mtr_t *mtr) |
Set the page number in the external field reference. More... | |
void | set_offset (const ulint offset, mtr_t *mtr) |
Set the offset information in the external field reference. More... | |
void | set_length (const ulint len, mtr_t *mtr) |
Set the length of blob in the external field reference. More... | |
page_t * | page_align () const |
Get the start of a page containing this blob reference. More... | |
bool | validate (mtr_t *mtr) |
Check if the given mtr has necessary latches to update this LOB reference. More... | |
bool | check_space_id (dict_index_t *index) const |
Check if the space_id in the LOB reference is equal to the space_id of the index to which it belongs. More... | |
bool | is_lob_partially_updatable (const dict_index_t *index) const |
Check if the LOB can be partially updated. More... | |
void | mark_not_partially_updatable (trx_t *trx, mtr_t *mtr, dict_index_t *index, const page_size_t &page_size) |
Load the first page of the LOB and mark it as not partially updatable anymore. More... | |
ulint | get_lob_page_info (const dict_index_t *index, const page_size_t &page_size, bool &is_partially_updatable) const |
Load the first page of LOB and read its page type. More... | |
std::ostream & | print (std::ostream &out) const |
Print this LOB reference into the given output stream. More... | |
Static Public Member Functions | |
static bool | use_single_z_stream (ulint len) |
For compressed LOB, if the length is less than or equal to Z_CHUNK_SIZE then use the older single z stream format to store the LOB. More... | |
static bool | is_big (const page_size_t &page_size, const ulint lob_length) |
Check if this LOB is big enough to do partial update. More... | |
static bool | is_null_relaxed (const byte *ref) |
Check if the LOB reference is null (all zeroes) except the "is being
modified" bit. More... | |
static bool | is_null (const byte *ref) |
Check if the LOB reference is null (all zeroes). More... | |
static void | set_being_modified (byte *ref, bool modifying, mtr_t *mtr) |
Set the being_modified flag in the field reference. More... | |
static bool | is_being_modified (const byte *field_ref) |
Check if the current blob is being modified. More... | |
static space_id_t | space_id (const byte *ref) |
Read the space id from the given blob reference. More... | |
static page_no_t | page_no (const byte *ref) |
Read the page no from the blob reference. More... | |
Static Public Attributes | |
static const ulint | LOB_SMALL_CHANGE_THRESHOLD = 100 |
If the total number of bytes modified in an LOB, in an update operation, is less than or equal to this threshold LOB_SMALL_CHANGE_THRESHOLD, then it is considered as a small change. More... | |
static const uint | SIZE = BTR_EXTERN_FIELD_REF_SIZE |
The size of an LOB reference object (in bytes) More... | |
Private Attributes | |
byte * | m_ref |
Pointing to a memory of size BTR_EXTERN_FIELD_REF_SIZE. More... | |
Static Private Attributes | |
static const ulint | LOB_BIG_THRESHOLD_SIZE = 2 |
If the LOB size is equal to or above this limit (in physical page size terms), then the LOB is big enough to be partially updated. More... | |
The struct 'lob::ref_t' represents an external field reference.
The reference in a field for which data is stored on a different page. The reference is at the end of the 'locally' stored part of the field. 'Locally' means storage in the index record. We store locally a long enough prefix of each column so that we can determine the ordering parts of each index record without looking into the externally stored part.
|
inlineexplicit |
Constructor.
[in] | ptr | Pointer to the external field reference. |
bool lob::ref_t::check_space_id | ( | dict_index_t * | index | ) | const |
Check if the space_id in the LOB reference is equal to the space_id of the index to which it belongs.
[in] | index | the index to which LOB belongs. |
|
inline |
Copy the LOB reference into the given memory location.
[out] | field_ref | write LOB reference in this location. |
ulint lob::ref_t::get_lob_page_info | ( | const dict_index_t * | index, |
const page_size_t & | page_size, | ||
bool & | is_partially_updatable | ||
) | const |
Load the first page of LOB and read its page type.
[in] | index | the index object. |
[in] | page_size | the page size of LOB. |
[out] | is_partially_updatable | is the LOB partially updatable. |
|
inline |
Check if the current blob is being modified.
|
inlinestatic |
Check if the current blob is being modified.
[in] | field_ref | blob field reference |
|
inline |
Check if this LOB is big enough to do partial update.
[in] | page_size | the page size |
|
inlinestatic |
Check if this LOB is big enough to do partial update.
[in] | page_size | the page size |
[in] | lob_length | the size of BLOB in bytes. |
|
inline |
Check whether the stored external field reference is equal to the given field reference.
[in] | ptr | supplied external field reference. |
|
inline |
Check if the current row inherited the blob from parent row.
bool lob::ref_t::is_lob_partially_updatable | ( | const dict_index_t * | index | ) | const |
Check if the LOB can be partially updated.
This is done by loading the first page of LOB and looking at the flags.
[in] | index | the index to which LOB belongs. |
|
inline |
Check if the field reference is made of zeroes.
|
inlinestatic |
Check if the LOB reference is null (all zeroes).
[in] | ref | the LOB reference. |
|
inline |
Check if the field reference is made of zeroes except the being_modified bit.
|
inlinestatic |
Check if the LOB reference is null (all zeroes) except the "is being modified" bit.
[in] | ref | the LOB reference. |
|
inline |
Check if the current row is the owner of the blob.
|
inline |
Read the length from the blob reference.
void lob::ref_t::mark_not_partially_updatable | ( | trx_t * | trx, |
mtr_t * | mtr, | ||
dict_index_t * | index, | ||
const page_size_t & | page_size | ||
) |
Load the first page of the LOB and mark it as not partially updatable anymore.
[in] | trx | Current transaction |
[in] | mtr | Mini-transaction context. |
[in] | index | Index dictionary object. |
[in] | page_size | Page size information. |
|
inline |
Read the offset of blob header from the blob reference.
|
inline |
Get the start of a page containing this blob reference.
|
inline |
Read the page number from the blob reference.
Read the page no from the blob reference.
|
inline |
Parse the LOB reference object and copy data into the given ref_mem_t object.
[out] | obj | LOB reference memory object. |
std::ostream & lob::ref_t::print | ( | std::ostream & | out | ) | const |
Print this LOB reference into the given output stream.
[in] | out | the output stream. |
|
inline |
Set the being_modified flag in the field reference.
[in] | modifying | true, if blob is being modified. |
[in] | mtr | Mini-transaction context. |
Set the being_modified flag in the field reference.
[in,out] | ref | The LOB reference |
[in] | modifying | true, if blob is being modified. |
[in] | mtr | Mini-transaction context. |
|
inline |
Set the inherited flag in the field reference.
[in] | inherited | true, if inherited. |
[in] | mtr | Mini-transaction context. |
Set the length of blob in the external field reference.
[in] | len | the blob length . |
[in] | mtr | mini-trx or NULL. |
Set the offset information in the external field reference.
[in] | offset | the offset. |
[in] | mtr | mini-trx or NULL. |
|
inline |
Set the ownership flag in the blob reference.
[in] | owner | Whether to own or disown. If owner, unset the owner flag. |
[in] | mtr | Mini-transaction or NULL. |
Set the page number in the external field reference.
[in] | page_no | the page number. |
[in] | mtr | mini-trx or NULL. |
|
inline |
Set the external field reference to the given memory location.
[in] | ptr | the new external field reference. |
|
inline |
Set the space_id in the external field reference.
[in] | space_id | the space identifier. |
[in] | mtr | mini-trx or NULL. |
|
inline |
Read the space id from the blob reference.
|
inlinestatic |
Read the space id from the given blob reference.
[in] | ref | the blob reference. |
|
inline |
Update the information stored in the external field reference.
[in] | space_id | the space identifier. |
[in] | page_no | the page number. |
[in] | offset | the offset within the page_no |
[in] | mtr | the mini trx or NULL. |
|
inline |
For compressed LOB, if the length is less than or equal to Z_CHUNK_SIZE then use the older single z stream format to store the LOB.
|
inlinestatic |
For compressed LOB, if the length is less than or equal to Z_CHUNK_SIZE then use the older single z stream format to store the LOB.
|
inline |
Check if the given mtr has necessary latches to update this LOB reference.
[in] | mtr | Mini-transaction that needs to be checked. |
|
inline |
Read the LOB version from the blob reference.
|
staticprivate |
If the LOB size is equal to or above this limit (in physical page size terms), then the LOB is big enough to be partially updated.
Only in this case LOB index needs to be built.
|
static |
If the total number of bytes modified in an LOB, in an update operation, is less than or equal to this threshold LOB_SMALL_CHANGE_THRESHOLD, then it is considered as a small change.
For small changes to LOB, the changes are undo logged like any other update operation.
|
private |
Pointing to a memory of size BTR_EXTERN_FIELD_REF_SIZE.
|
static |
The size of an LOB reference object (in bytes)