MySQL 8.4.2
Source Code Documentation
lob Namespace Reference

Provides the large objects (LOB) module. More...

Classes

struct  BaseInserter
 This struct can hold BLOB routines/functions, and state variables, that are common for compressed and uncompressed BLOB. More...
 
struct  basic_page_t
 
struct  Being_modified
 This is used to take action when we enter and exit a scope. More...
 
struct  blob_dir_t
 The in-memory blob directory. More...
 
struct  blob_page_info_t
 Information about data stored in one BLOB page. More...
 
class  BtrContext
 The B-tree context under which the LOB operation is done. More...
 
struct  data_page_t
 The LOB data page carrying the user data. More...
 
struct  DeleteContext
 The context information when the delete operation on LOB is taking place. More...
 
class  Deleter
 
struct  first_page_t
 The first page of an uncompressed LOB. More...
 
struct  frag_node_t
 The fragment node represents one fragment. More...
 
struct  index_entry_mem_t
 An in-memory copy of an index_entry_t data. More...
 
struct  index_entry_t
 An index entry pointing to an LOB page. More...
 
struct  InsertContext
 The context for a LOB operation. More...
 
class  Inserter
 Insert or write an uncompressed BLOB. More...
 
struct  node_page_t
 The node page (also can be called as the index page) contains a list of index_entry_t objects. More...
 
struct  plist_base_node_t
 The base node of page list. More...
 
class  plist_node_t
 The node of page list. More...
 
struct  ReadContext
 The context information for reading a single BLOB. More...
 
struct  Reader
 Fetch uncompressed BLOB. More...
 
struct  ref_mem_t
 In memory representation of the LOB reference. More...
 
struct  ref_t
 The struct 'lob::ref_t' represents an external field reference. More...
 
struct  undo_data_t
 Undo information about LOB data alone without including LOB index. More...
 
struct  undo_seq_t
 Container to hold a sequence of undo log records containing modification of BLOBs. More...
 
struct  undo_vers_t
 The list of modifications to be applied on LOBs to get older versions. More...
 
struct  z_data_page_t
 The data page holding the zlob. More...
 
struct  z_first_page_t
 The first page of an zlob. More...
 
struct  z_frag_entry_t
 An entry representing one fragment page. More...
 
struct  z_frag_node_page_t
 A frag nodes page containing an array of z_frag_entry_t objects. More...
 
struct  z_frag_page_t
 The fragment page. More...
 
struct  z_index_entry_mem_t
 In-memory copy of the information from z_index_entry_t. More...
 
struct  z_index_entry_t
 An index entry pointing to one zlib stream. More...
 
struct  z_index_page_t
 An index page containing an array of z_index_entry_t objects. More...
 
class  zInserter
 Insert or write the compressed BLOB as a single zlib stream. More...
 
struct  zReader
 Fetch compressed BLOB. More...
 

Typedefs

using paddr_t = ulint
 
using frag_id_t = ulint
 
typedef std::map< page_no_t, buf_block_t * > BlockCache
 
using List_iem_t = std::list< index_entry_mem_t >
 List of index entry memory (iem) objects. More...
 

Enumerations

enum  opcode {
  OPCODE_INSERT = 0 , OPCODE_INSERT_UPDATE , OPCODE_UPDATE , OPCODE_INSERT_BULK ,
  OPCODE_UNKNOWN
}
 LOB operation code for btr_store_big_rec_extern_fields(). More...
 

Functions

std::ostream & operator<< (std::ostream &out, const plist_node_t &obj)
 
std::ostream & operator<< (std::ostream &out, const plist_base_node_t &obj)
 
std::ostream & operator<< (std::ostream &out, const z_frag_entry_t &obj)
 
dberr_t z_print_info (const dict_index_t *index, const lob::ref_t &ref, std::ostream &out)
 Print information about the given compressed lob. More...
 
std::ostream & operator<< (std::ostream &out, const frag_node_t &obj)
 
dberr_t z_insert_chunk (dict_index_t *index, z_first_page_t &first, trx_t *trx, byte *blob, ulint len, z_index_entry_t *out_entry, mtr_t *mtr, bool bulk)
 Insert one chunk of input. More...
 
std::ostream & operator<< (std::ostream &out, const index_entry_mem_t &obj)
 Overloading the global output operator to print the index_entry_mem_t object. More...
 
std::ostream & operator<< (std::ostream &out, const index_entry_t &obj)
 Overloading the global output operator to easily print an index entry. More...
 
dberr_t insert (InsertContext *ctx, trx_t *trx, ref_t &ref, big_rec_field_t *field, ulint field_j)
 Insert a large object (LOB) into the system. More...
 
dberr_t z_insert (InsertContext *ctx, trx_t *trx, ref_t &ref, big_rec_field_t *field, ulint field_j)
 Insert a compressed large object (LOB) into the system. More...
 
ulint read (ReadContext *ctx, ref_t ref, ulint offset, ulint len, byte *buf)
 Fetch a large object (LOB) from the system. More...
 
ulint z_read (lob::ReadContext *ctx, lob::ref_t ref, ulint offset, ulint len, byte *buf)
 Fetch a compressed large object (ZLOB) from the system. More...
 
void print (trx_t *trx, dict_index_t *index, std::ostream &out, ref_t ref, bool fatal)
 Print information about the given LOB. More...
 
dberr_t update (trx_t *trx, dict_index_t *index, const upd_t *upd, ulint field_no)
 Update a portion of the given LOB. More...
 
dberr_t z_update (trx_t *trx, dict_index_t *index, const upd_t *upd, ulint field_no)
 Update a portion of the given LOB. More...
 
dberr_t get_affected_index_entries (const ref_t &ref, dict_index_t *index, const Binary_diff &bdiff, List_iem_t &entries, mtr_t *mtr)
 Get the list of index entries affected by the given partial update vector. More...
 
dberr_t apply_undolog (mtr_t *mtr, dict_index_t *index, ref_t ref, const upd_field_t *uf)
 Apply the undo log on the LOB. More...
 
dberr_t get_info (ref_t &ref, dict_index_t *index, ulint &lob_version, trx_id_t &last_trx_id, undo_no_t &last_undo_no, page_type_t &page_type, mtr_t *mtr)
 Get information about the given LOB. More...
 
bool validate_size (const ulint lob_size, dict_index_t *index, fil_addr_t node_loc, mtr_t *mtr)
 Validate the size of the given LOB. More...
 
std::ostream & operator<< (std::ostream &out, const ref_t &obj)
 Overload the global output stream operator to easily print the lob::ref_t object into the output stream. More...
 
dberr_t btr_store_big_rec_extern_fields (trx_t *trx, btr_pcur_t *pcur, const upd_t *upd, ulint *offsets, const big_rec_t *big_rec_vec, mtr_t *btr_mtr, opcode op)
 Stores the fields in big_rec_vec to the tablespace and puts pointers to them in rec. More...
 
bytebtr_rec_copy_externally_stored_field_func (trx_t *trx, const dict_index_t *index, const rec_t *rec, const ulint *offsets, const page_size_t &page_size, ulint no, ulint *len, size_t *lob_version, bool is_sdi, mem_heap_t *heap, bool is_rebuilt)
 Copies an externally stored field of a record to mem heap. More...
 
static bytebtr_rec_copy_externally_stored_field (trx_t *trx, const dict_index_t *index, const rec_t *rec, const ulint *offsets, const page_size_t &page_size, ulint no, ulint *len, size_t *ver, bool is_sdi, mem_heap_t *heap)
 
ulint btr_rec_get_field_ref_offs (const dict_index_t *index, const ulint *offsets, ulint n)
 Gets the offset of the pointer to the externally stored part of a field. More...
 
static const bytebtr_rec_get_field_ref (const dict_index_t *index, const byte *rec, const ulint *offsets, ulint n)
 Gets a pointer to the externally stored part of a field. More...
 
static bytebtr_rec_get_field_ref (const dict_index_t *index, byte *rec, const ulint *offsets, ulint n)
 Gets a pointer to the externally stored part of a field. More...
 
void blob_free (dict_index_t *index, buf_block_t *block, bool all, mtr_t *mtr)
 Deallocate a buffer block that was reserved for a BLOB part. More...
 
std::ostream & operator<< (std::ostream &out, const blob_page_info_t &obj)
 
std::ostream & operator<< (std::ostream &out, const blob_dir_t &obj)
 Overloading the global output operator to print the blob_dir_t object into an output stream. More...
 
bool btr_lob_op_is_update (opcode op)
 Determine if an operation on off-page columns is an update. More...
 
ulint btr_copy_externally_stored_field_prefix_func (trx_t *trx, const dict_index_t *index, byte *buf, ulint len, const page_size_t &page_size, const byte *data, bool is_sdi, ulint local_len)
 Copies the prefix of an externally stored field of a record. More...
 
bytebtr_copy_externally_stored_field_func (trx_t *trx, const dict_index_t *index, ulint *len, size_t *lob_version, const byte *data, const page_size_t &page_size, ulint local_len, bool is_sdi, mem_heap_t *heap)
 Copies an externally stored field of a record to mem heap. More...
 
static ulint btr_copy_externally_stored_field_prefix (trx_t *trx, const dict_index_t *index, byte *buf, ulint len, const page_size_t &page_size, const byte *data, bool is_sdi, ulint local_len)
 
static bytebtr_copy_externally_stored_field (trx_t *trx, const dict_index_t *index, ulint *len, size_t *ver, const byte *data, const page_size_t &page_size, ulint local_len, bool is_sdi, mem_heap_t *heap)
 
ulint btr_rec_get_externally_stored_len (const dict_index_t *index, const rec_t *rec, const ulint *offsets)
 Gets the externally stored size of a record, in units of a database page. More...
 
void purge (lob::DeleteContext *ctx, dict_index_t *index, trx_id_t trxid, undo_no_t undo_no, ulint rec_type, const upd_field_t *uf, purge_node_t *node)
 Purge an LOB (either of compressed or uncompressed). More...
 
dberr_t update (InsertContext &ctx, trx_t *trx, dict_index_t *index, const upd_t *upd, ulint field_no, ref_t blobref)
 Update a portion of the given LOB. More...
 
dberr_t z_update (InsertContext &ctx, trx_t *trx, dict_index_t *index, const upd_t *upd, ulint field_no, ref_t blobref)
 Update a portion of the given LOB. More...
 
void z_import (const dict_index_t *index, byte *field_ref, trx_id_t trx_id)
 Import the given LOB. More...
 
void import (const dict_index_t *index, byte *field_ref, trx_id_t trx_id)
 Import the given LOB. More...
 
bool rec_check_lobref_space_id (dict_index_t *index, const rec_t *rec, const ulint *offsets)
 Check if all the LOB references in the given clustered index record has valid space_id in it. More...
 
dberr_t mark_not_partially_updatable (trx_t *trx, dict_index_t *index, const upd_t *update, const mtr_t *btr_mtr)
 Mark an LOB that it is not partially updatable anymore. More...
 
std::ostream & operator<< (std::ostream &out, const undo_data_t &obj)
 
buf_block_talloc_lob_page (dict_index_t *index, mtr_t *lob_mtr, page_no_t hint, bool bulk)
 Allocate one LOB page. More...
 
bool entry_visible_to (dict_index_t *index, trx_t *trx, trx_id_t entry_trx_id)
 Check if the index entry is visible to the given transaction. More...
 
std::ostream & operator<< (std::ostream &out, const z_first_page_t &obj)
 Overloading the global output parameter to print object of type z_first_page_t into the given output stream. More...
 
std::ostream & operator<< (std::ostream &out, const z_index_entry_mem_t &obj)
 
std::ostream & operator<< (std::ostream &out, const z_index_entry_t &obj)
 
ulint z_read_chunk (dict_index_t *index, z_index_entry_t &entry, ulint offset, ulint &len, byte *&buf, mtr_t *mtr)
 Read one data chunk associated with one index entry. More...
 
ulint z_read_strm (dict_index_t *index, z_index_entry_t &entry, byte *zbuf, ulint zbuf_size, mtr_t *mtr)
 Read one zlib stream fully, given its index entry. More...
 
ulint z_read (ReadContext *ctx, trx_t *trx, lob::ref_t ref, ulint offset, ulint len, byte *buf)
 Fetch a compressed large object (ZLOB) from the system. More...
 
bool z_validate_strm (dict_index_t *index, z_index_entry_t &entry, mtr_t *mtr)
 Validate one zlib stream, given its index entry. More...
 
static page_no_t btr_blob_get_next_page_no (const byte *blob_header)
 Returns the page number where the next BLOB part is stored. More...
 
static void buf_block_set_next_page_no (buf_block_t *block, page_no_t next_page_no, mtr_t *mtr)
 
dberr_t z_insert_strm (dict_index_t *index, z_first_page_t &first, trx_id_t trxid, byte *blob, ulint len, mtr_t *mtr, bool bulk, page_no_t &start_page_no, frag_id_t &frag_id)
 Insert a single zlib stream. More...
 
static page_no_t btr_blob_get_next_page_no (const byte *blob_header)
 Returns the page number where the next BLOB part is stored. More...
 
static void btr_check_blob_fil_page_type (space_id_t space_id, page_no_t page_no, const page_t *page, bool read)
 Check the FIL_PAGE_TYPE on an uncompressed BLOB page. More...
 
static ulint btr_blob_get_part_len (const byte *blob_header)
 Returns the length of a BLOB part stored on the header page. More...
 
static void rollback_from_undolog (DeleteContext *ctx, dict_index_t *index, const upd_field_t *uf)
 Rollback from undo log information. More...
 
static void rollback (DeleteContext *ctx, dict_index_t *index, trx_id_t trxid, undo_no_t undo_no, ulint rec_type, const upd_field_t *uf)
 Rollback modification of a uncompressed LOB. More...
 
static void z_rollback (DeleteContext *ctx, dict_index_t *index, trx_id_t trxid, undo_no_t undo_no, ulint rec_type)
 Rollback modification of a compressed LOB. More...
 
static void z_purge (DeleteContext *ctx, dict_index_t *index, trx_id_t trxid, undo_no_t undo_no, ulint rec_type, purge_node_t *purge_node)
 Purge a compressed LOB. More...
 
dberr_t replace (InsertContext &ctx, trx_t *trx, dict_index_t *index, ref_t ref, first_page_t &first_page, ulint offset, ulint len, byte *buf, int count)
 Replace a large object (LOB) with the given new data of equal length. More...
 
static dberr_t replace_inline (InsertContext &ctx, trx_t *trx, dict_index_t *index, ref_t ref, first_page_t &first_page, ulint offset, ulint len, byte *buf)
 Replace a small portion of large object (LOB) with the given new data of equal length. More...
 
static void print_partial_update_hit (upd_field_t *uf, dict_index_t *index)
 Print an information message in the server log file, informing that the LOB partial update feature code is hit. More...
 
fil_addr_t find_offset (dict_index_t *index, fil_addr_t node_loc, ulint &offset, mtr_t *mtr)
 Find the file location of the index entry which gives the portion of LOB containing the requested offset. More...
 
static bool z_validate_strm_low (dict_index_t *index, z_index_entry_t &entry, mtr_t *mtr)
 
static dberr_t z_replace (InsertContext &ctx, trx_t *trx, dict_index_t *index, ref_t ref, z_first_page_t &first_page, ulint offset, ulint len, byte *buf)
 Replace a large object (LOB) with the given new data. More...
 
static void z_print_partial_update_hit (upd_field_t *uf, dict_index_t *index)
 Print an information message in the server log file, informing that the ZLOB partial update feature code is hit. More...
 
fil_addr_t z_find_offset (dict_index_t *index, fil_addr_t node_loc, ulint &offset, mtr_t *mtr)
 Find the location of the given offset within LOB. More...
 

Variables

const ulint FRAG_ID_NULL = std::numeric_limits<uint16_t>::max()
 
const ulint KB16 = 16 * 1024
 
const ulint MAX_SIZE = UINT32_MAX
 The maximum size possible for an LOB. More...
 
constexpr uint32_t KB128 = 128 * 1024
 The compressed LOB is stored as a collection of zlib streams. More...
 
constexpr uint32_t Z_CHUNK_SIZE = KB128
 
const ulint BTR_EXTERN_SPACE_ID = 0
 The reference in a field for which data is stored on a different page. More...
 
const ulint BTR_EXTERN_PAGE_NO = 4
 page number where stored More...
 
const ulint BTR_EXTERN_OFFSET = 8
 offset of BLOB header on that page More...
 
const ulint BTR_EXTERN_VERSION = BTR_EXTERN_OFFSET
 Version number of LOB (LOB in new format) More...
 
const ulint BTR_EXTERN_LEN = 12
 8 bytes containing the length of the externally stored part of the LOB. More...
 
const ulint BTR_EXTERN_OWNER_FLAG = 128UL
 The most significant bit of BTR_EXTERN_LEN (i.e., the most significant bit of the byte at smallest address) is set to 1 if this field does not 'own' the externally stored field; only the owner field is allowed to free the field in purge! More...
 
const ulint BTR_EXTERN_INHERITED_FLAG = 64UL
 If the second most significant bit of BTR_EXTERN_LEN (i.e., the second most significant bit of the byte at smallest address) is 1 then it means that the externally stored field was inherited from an earlier version of the row. More...
 
const ulint BTR_EXTERN_BEING_MODIFIED_FLAG = 32UL
 If the 3rd most significant bit of BTR_EXTERN_LEN is 1, then it means that the externally stored field is currently being modified. More...
 
const ulint LOB_HDR_PART_LEN = 0
 The structure of uncompressed LOB page header. More...
 
const ulint LOB_HDR_NEXT_PAGE_NO = 4
 Offset within header of next BLOB part page no. More...
 
const ulint LOB_HDR_SIZE = 8
 Size of an uncompressed LOB page header, in bytes. More...
 
const uint ZLOB_PAGE_DATA = FIL_PAGE_DATA
 Start of the data on an LOB page. More...
 
const byte field_ref_almost_zero [FIELD_REF_SIZE]
 A BLOB field reference has all the bits set to zero, except the "being modified" bit. More...
 
const uint32_t MAX_PARTIAL_UPDATE_LIMIT = 1000
 Number of times an LOB can be partially updated. More...
 

Detailed Description

Provides the large objects (LOB) module.

Previously, the LOB was called as externally stored fields.

Typedef Documentation

◆ BlockCache

typedef std::map<page_no_t, buf_block_t *> lob::BlockCache

◆ frag_id_t

using lob::frag_id_t = typedef ulint

◆ List_iem_t

using lob::List_iem_t = typedef std::list<index_entry_mem_t>

List of index entry memory (iem) objects.

◆ paddr_t

using lob::paddr_t = typedef ulint

Enumeration Type Documentation

◆ opcode

LOB operation code for btr_store_big_rec_extern_fields().

Enumerator
OPCODE_INSERT 

Store off-page columns for a freshly inserted record.

OPCODE_INSERT_UPDATE 

Store off-page columns for an insert by update.

OPCODE_UPDATE 

Store off-page columns for an update.

OPCODE_INSERT_BULK 

Store off-page columns for a freshly inserted record by bulk.

OPCODE_UNKNOWN 

The operation code is unknown or not important.

Function Documentation

◆ alloc_lob_page()

buf_block_t * lob::alloc_lob_page ( dict_index_t index,
mtr_t lob_mtr,
page_no_t  hint,
bool  bulk 
)

Allocate one LOB page.

Parameters
[in]indexIndex in which LOB exists.
[in]lob_mtrMini-transaction context.
[in]hintHint page number for allocation.
[in]bulktrue if operation is OPCODE_INSERT_BULK, false otherwise.
Returns
the allocated block of the BLOB page or nullptr.

◆ apply_undolog()

dberr_t lob::apply_undolog ( mtr_t mtr,
dict_index_t index,
ref_t  ref,
const upd_field_t uf 
)

Apply the undo log on the LOB.

Parameters
[in]mtrMini-transaction context.
[in]indexClustered index to which LOB belongs.
[in]refLOB reference object.
[in]ufUpdate vector for LOB field.
Returns
DB_SUCCESS on success, error code on failure.

◆ blob_free()

void lob::blob_free ( dict_index_t index,
buf_block_t block,
bool  all,
mtr_t mtr 
)

Deallocate a buffer block that was reserved for a BLOB part.

Parameters
[in]indexIndex
[in]blockBuffer block
[in]alltrue=remove also the compressed page if there is one
[in]mtrMini-transaction to commit

◆ btr_blob_get_next_page_no() [1/2]

static page_no_t lob::btr_blob_get_next_page_no ( const byte blob_header)
inlinestatic

Returns the page number where the next BLOB part is stored.

Parameters
[in]blob_headerthe BLOB header.
Returns
page number or FIL_NULL if no more pages

◆ btr_blob_get_next_page_no() [2/2]

static page_no_t lob::btr_blob_get_next_page_no ( const byte blob_header)
inlinestatic

Returns the page number where the next BLOB part is stored.

Parameters
[in]blob_headerthe BLOB header.
Returns
page number or FIL_NULL if no more pages

◆ btr_blob_get_part_len()

static ulint lob::btr_blob_get_part_len ( const byte blob_header)
inlinestatic

Returns the length of a BLOB part stored on the header page.

Parameters
[in]blob_headerthe BLOB header.
Returns
part length

◆ btr_check_blob_fil_page_type()

static void lob::btr_check_blob_fil_page_type ( space_id_t  space_id,
page_no_t  page_no,
const page_t page,
bool  read 
)
static

Check the FIL_PAGE_TYPE on an uncompressed BLOB page.

Parameters
[in]space_idspace identifier.
[in]page_nopage number.
[in]pagethe page
[in]readtrue=read, false=purge

◆ btr_copy_externally_stored_field()

static byte * lob::btr_copy_externally_stored_field ( trx_t trx,
const dict_index_t index,
ulint len,
size_t *  ver,
const byte data,
const page_size_t page_size,
ulint  local_len,
bool  is_sdi,
mem_heap_t heap 
)
inlinestatic

◆ btr_copy_externally_stored_field_func()

byte * lob::btr_copy_externally_stored_field_func ( trx_t trx,
const dict_index_t index,
ulint len,
size_t *  lob_version,
const byte data,
const page_size_t page_size,
ulint  local_len,
bool  is_sdi,
mem_heap_t heap 
)

Copies an externally stored field of a record to mem heap.

The clustered index record must be protected by a lock or a page latch.

Parameters
[in]trxthe current trx object or nullptr
[in]indexthe clust index in which lob is read.
[out]lenlength of the whole field
[out]lob_versionLOB version number.
[in]data'internally' stored part of the field containing also the reference to the external part; must be protected by a lock or a page latch.
[in]page_sizeBLOB page size
[in]local_lenlength of data
[in]is_sditrue for SDI Indexes
[in,out]heapmem heap
Returns
the whole field copied to heap

◆ btr_copy_externally_stored_field_prefix()

static ulint lob::btr_copy_externally_stored_field_prefix ( trx_t trx,
const dict_index_t index,
byte buf,
ulint  len,
const page_size_t page_size,
const byte data,
bool  is_sdi,
ulint  local_len 
)
inlinestatic

◆ btr_copy_externally_stored_field_prefix_func()

ulint lob::btr_copy_externally_stored_field_prefix_func ( trx_t trx,
const dict_index_t index,
byte buf,
ulint  len,
const page_size_t page_size,
const byte data,
bool  is_sdi,
ulint  local_len 
)

Copies the prefix of an externally stored field of a record.

The clustered index record must be protected by a lock or a page latch.

Parameters
[in]trxthe current transaction object if available or nullptr.
[in]indexthe clust index in which lob is read.
[out]bufthe field, or a prefix of it
[in]lenlength of buf, in bytes
[in]page_sizeBLOB page size
[in]data'internally' stored part of the field containing also the reference to the external part; must be protected by a lock or a page latch.
[in]is_sditrue for SDI indexes
[in]local_lenlength of data, in bytes
Returns
the length of the copied field, or 0 if the column was being or has been deleted

◆ btr_lob_op_is_update()

bool lob::btr_lob_op_is_update ( opcode  op)
inline

Determine if an operation on off-page columns is an update.

Parameters
[in]optype of BLOB operation.
Returns
true if op != OPCODE_INSERT

◆ btr_rec_copy_externally_stored_field()

static byte * lob::btr_rec_copy_externally_stored_field ( trx_t trx,
const dict_index_t index,
const rec_t rec,
const ulint offsets,
const page_size_t page_size,
ulint  no,
ulint len,
size_t *  ver,
bool  is_sdi,
mem_heap_t heap 
)
inlinestatic

◆ btr_rec_copy_externally_stored_field_func()

byte * lob::btr_rec_copy_externally_stored_field_func ( trx_t trx,
const dict_index_t index,
const rec_t rec,
const ulint offsets,
const page_size_t page_size,
ulint  no,
ulint len,
size_t *  lob_version,
bool  is_sdi,
mem_heap_t heap,
bool  is_rebuilt 
)

Copies an externally stored field of a record to mem heap.

Parameters
[in]trxthe current transaction.
[in]indexthe clustered index
[in]recrecord in a clustered index; must be protected by a lock or a page latch
[in]offsetsarray returned by rec_get_offsets()
[in]page_sizeBLOB page size
[in]nofield number
[out]lenlength of the field
[out]lob_versionversion of lob that has been copied
[in]is_sditrue for SDI Indexes
[in,out]heapmem heap
[in]is_rebuilttrue if rebuilt
Returns
the field copied to heap, or NULL if the field is incomplete

◆ btr_rec_get_externally_stored_len()

ulint lob::btr_rec_get_externally_stored_len ( const dict_index_t index,
const rec_t rec,
const ulint offsets 
)

Gets the externally stored size of a record, in units of a database page.

Parameters
[in]indexindex
[in]recrecord
[in]offsetsarray returned by rec_get_offsets()
Returns
externally stored part, in units of a database page

◆ btr_rec_get_field_ref() [1/2]

static byte * lob::btr_rec_get_field_ref ( const dict_index_t index,
byte rec,
const ulint offsets,
ulint  n 
)
inlinestatic

Gets a pointer to the externally stored part of a field.

Parameters
indexrecord descriptor
recrecord
offsetsrec_get_offsets(rec)
nindex of the externally stored field
Returns
pointer to the externally stored part

◆ btr_rec_get_field_ref() [2/2]

static const byte * lob::btr_rec_get_field_ref ( const dict_index_t index,
const byte rec,
const ulint offsets,
ulint  n 
)
inlinestatic

Gets a pointer to the externally stored part of a field.

Parameters
[in]indexindex
recrecord
offsetsrec_get_offsets(rec)
nindex of the externally stored field
Returns
pointer to the externally stored part

◆ btr_rec_get_field_ref_offs()

ulint lob::btr_rec_get_field_ref_offs ( const dict_index_t index,
const ulint offsets,
ulint  n 
)

Gets the offset of the pointer to the externally stored part of a field.

Parameters
[in]indexIndex
[in]offsetsarray returned by rec_get_offsets()
[in]nindex of the external field
Returns
offset of the pointer to the externally stored part

◆ btr_store_big_rec_extern_fields()

dberr_t lob::btr_store_big_rec_extern_fields ( trx_t trx,
btr_pcur_t pcur,
const upd_t upd,
ulint offsets,
const big_rec_t big_rec_vec,
mtr_t btr_mtr,
opcode  op 
)

Stores the fields in big_rec_vec to the tablespace and puts pointers to them in rec.

The extern flags in rec will have to be set beforehand. The fields are stored on pages allocated from leaf node file segment of the index tree.

TODO: If the allocation extends the tablespace, it will not be redo logged, in any mini-transaction. Tablespace extension should be redo-logged, so that recovery will not fail when the big_rec was written to the extended portion of the file, in case the file was somehow truncated in the crash.

Parameters
[in]trxthe trx doing LOB store. If unavailable it could be nullptr.
[in,out]pcura persistent cursor. if btr_mtr is restarted, then this can be repositioned.
[in]updupdate vector
[in,out]offsetsrec_get_offsets() on pcur. the "external in offsets will correctly correspond storage" flagsin offsets will correctly correspond to rec when this function returns
[in]big_rec_vecvector containing fields to be stored externally
[in,out]btr_mtrmtr containing the latches to the clustered index. can be committed and restarted.
[in]opoperation code
Returns
DB_SUCCESS or DB_OUT_OF_FILE_SPACE

◆ buf_block_set_next_page_no()

static void lob::buf_block_set_next_page_no ( buf_block_t block,
page_no_t  next_page_no,
mtr_t mtr 
)
static

◆ entry_visible_to()

bool lob::entry_visible_to ( dict_index_t index,
trx_t trx,
trx_id_t  entry_trx_id 
)

Check if the index entry is visible to the given transaction.

Parameters
[in]indexthe index to which LOB belongs.
[in]trxthe transaction reading the index entry.
[in]entry_trx_idthe trx id in the index entry.

◆ find_offset()

fil_addr_t lob::find_offset ( dict_index_t index,
fil_addr_t  node_loc,
ulint offset,
mtr_t mtr 
)

Find the file location of the index entry which gives the portion of LOB containing the requested offset.

Parameters
[in]indexThe clustered index containing LOB.
[in]node_locLocation of first index entry.
[in]offsetThe LOB offset whose location we seek.
[in]mtrMini-transaction context.
Returns
file location of index entry which contains requested LOB offset.

◆ get_affected_index_entries()

dberr_t lob::get_affected_index_entries ( const ref_t ref,
dict_index_t index,
const Binary_diff bdiff,
List_iem_t entries,
mtr_t mtr 
)

Get the list of index entries affected by the given partial update vector.

Parameters
[in]refLOB reference object.
[in]indexClustered index to which LOB belongs.
[in]bdiffSingle partial update vector
[out]entriesAffected LOB index entries.
[in]mtrMini-transaction
Returns
DB_SUCCESS on success, error code on failure.

◆ get_info()

dberr_t lob::get_info ( ref_t ref,
dict_index_t index,
ulint lob_version,
trx_id_t last_trx_id,
undo_no_t last_undo_no,
page_type_t page_type,
mtr_t mtr 
)

Get information about the given LOB.

Parameters
[in]refLOB reference.
[in]indexClustered index to which LOB belongs.
[out]lob_versionLOB version number.
[out]last_trx_idtrx_id that modified the lob last.
[out]last_undo_noTrx undo no that modified the lob last.
[out]page_typethe Page type of first lob page.
[in]mtrMini-transaction context.
Returns
always returns DB_SUCCESS.

◆ import()

void lob::import ( const dict_index_t index,
byte field_ref,
trx_id_t  trx_id 
)

Import the given LOB.

Update the creator trx id and the modifier trx id to the given import trx id.

Parameters
[in]indexclustered index containing the lob.
[in]field_refthe lob reference.
[in]trx_idthe import trx id.

◆ insert()

dberr_t lob::insert ( InsertContext ctx,
trx_t trx,
ref_t ref,
big_rec_field_t field,
ulint  field_j 
)

Insert a large object (LOB) into the system.

Parameters
[in]ctxthe B-tree context for this LOB operation.
[in]trxtransaction doing the insertion.
[in,out]refthe LOB reference.
[in]fieldthe LOB field.
[in]field_jthe LOB field index in big rec vector.
Returns
DB_SUCCESS on success, error code on failure.

◆ mark_not_partially_updatable()

dberr_t lob::mark_not_partially_updatable ( trx_t trx,
dict_index_t index,
const upd_t update,
const mtr_t btr_mtr 
)

Mark an LOB that it is not partially updatable anymore.

Parameters
[in]trxCurrent transaction.
[in]indexClustered index to which the LOB belongs.
[in]updateUpdate vector.
[in]btr_mtrMini-transaction context holding latches on the B-tree. This function does not generate redo log using this btr_mtr. It only obtains the log mode.
Returns
DB_SUCCESS on success, error code on failure.

◆ operator<<() [1/13]

std::ostream & lob::operator<< ( std::ostream &  out,
const blob_dir_t obj 
)
inline

Overloading the global output operator to print the blob_dir_t object into an output stream.

Parameters
[in,out]outthe output stream.
[in]objthe object to be printed.
Returns
the output stream.

◆ operator<<() [2/13]

std::ostream & lob::operator<< ( std::ostream &  out,
const blob_page_info_t obj 
)
inline

◆ operator<<() [3/13]

std::ostream & lob::operator<< ( std::ostream &  out,
const frag_node_t obj 
)
inline

◆ operator<<() [4/13]

std::ostream & lob::operator<< ( std::ostream &  out,
const index_entry_mem_t obj 
)
inline

Overloading the global output operator to print the index_entry_mem_t object.

Parameters
[in,out]outthe output stream.
[in]objan object of type index_entry_mem_t
Returns
the output stream.

◆ operator<<() [5/13]

std::ostream & lob::operator<< ( std::ostream &  out,
const index_entry_t obj 
)
inline

Overloading the global output operator to easily print an index entry.

Parameters
[in]outthe output stream.
[in]objthe index entry.
Returns
the output stream.

◆ operator<<() [6/13]

std::ostream & lob::operator<< ( std::ostream &  out,
const plist_base_node_t obj 
)
inline

◆ operator<<() [7/13]

std::ostream & lob::operator<< ( std::ostream &  out,
const plist_node_t obj 
)
inline

◆ operator<<() [8/13]

std::ostream & lob::operator<< ( std::ostream &  out,
const ref_t obj 
)
inline

Overload the global output stream operator to easily print the lob::ref_t object into the output stream.

Parameters
[in,out]outthe output stream.
[in]objthe lob::ref_t object to be printed
Returns
the output stream.

◆ operator<<() [9/13]

std::ostream & lob::operator<< ( std::ostream &  out,
const undo_data_t obj 
)
inline

◆ operator<<() [10/13]

std::ostream & lob::operator<< ( std::ostream &  out,
const z_first_page_t obj 
)
inline

Overloading the global output parameter to print object of type z_first_page_t into the given output stream.

Parameters
[in,out]outoutput stream.
[in]objobject to be printed.
Returns
the output stream.

◆ operator<<() [11/13]

std::ostream & lob::operator<< ( std::ostream &  out,
const z_frag_entry_t obj 
)
inline

◆ operator<<() [12/13]

std::ostream & lob::operator<< ( std::ostream &  out,
const z_index_entry_mem_t obj 
)
inline

◆ operator<<() [13/13]

std::ostream & lob::operator<< ( std::ostream &  out,
const z_index_entry_t obj 
)
inline

◆ print()

void lob::print ( trx_t trx,
dict_index_t index,
std::ostream &  out,
ref_t  ref,
bool  fatal 
)

Print information about the given LOB.

Parameters
[in]trxthe current transaction.
[in]indexthe clust index that contains the LOB.
[in]outthe output stream into which LOB info is printed.
[in]refthe LOB reference
[in]fatalif true assert at end of function.

◆ print_partial_update_hit()

static void lob::print_partial_update_hit ( upd_field_t uf,
dict_index_t index 
)
static

Print an information message in the server log file, informing that the LOB partial update feature code is hit.

Parameters
[in]ufthe update field information
[in]indexindex where partial update happens.

◆ purge()

void lob::purge ( lob::DeleteContext ctx,
dict_index_t index,
trx_id_t  trxid,
undo_no_t  undo_no,
ulint  rec_type,
const upd_field_t uf,
purge_node_t node 
)

Purge an LOB (either of compressed or uncompressed).

Parameters
[in]ctxthe delete operation context information.
[in]indexclustered index in which LOB is present
[in]trxidthe transaction that is being purged.
[in]undo_noduring rollback to savepoint, purge only up to this undo number.
[in]rec_typeundo record type.
[in]ufthe update vector for the field.
[in]nodethe purge node or nullptr.

◆ read()

ulint lob::read ( ReadContext ctx,
ref_t  ref,
ulint  offset,
ulint  len,
byte buf 
)

Fetch a large object (LOB) from the system.

Parameters
[in]ctxthe read context information.
[in]refthe LOB reference identifying the LOB.
[in]offsetread the LOB from the given offset.
[in]lenthe length of LOB data that needs to be fetched.
[out]bufthe output buffer (owned by caller) of minimum len bytes.
Returns
the amount of data (in bytes) that was actually read.

◆ rec_check_lobref_space_id()

bool lob::rec_check_lobref_space_id ( dict_index_t index,
const rec_t rec,
const ulint offsets 
)

Check if all the LOB references in the given clustered index record has valid space_id in it.

Parameters
[in]indexthe index to which the LOB belongs.
[in]recthe clust_rec in which the LOB references are checked.
[in]offsetsthe field offsets of the given rec.
Returns
true if LOB references have valid space_id, false otherwise.

◆ replace()

dberr_t lob::replace ( InsertContext ctx,
trx_t trx,
dict_index_t index,
ref_t  ref,
first_page_t first_page,
ulint  offset,
ulint  len,
byte buf,
int  count 
)

Replace a large object (LOB) with the given new data of equal length.

Parameters
[in]ctxreplace operation context.
[in]trxthe transaction that is doing the read.
[in]indexthe clustered index containing the LOB.
[in]refthe LOB reference identifying the LOB.
[in]first_pagethe first page of the LOB.
[in]offsetreplace the LOB from the given offset.
[in]lenthe length of LOB data that needs to be replaced.
[in]bufthe buffer (owned by caller) with new data (len bytes).
[in]countnumber of replace done on current LOB.
Returns
DB_SUCCESS on success, error code on failure.

Repeatedly updating the LOB should increment the ref count only once.

Repeatedly updating the LOB should increment the ref count only once.

◆ replace_inline()

static dberr_t lob::replace_inline ( InsertContext ctx,
trx_t trx,
dict_index_t index,
ref_t  ref,
first_page_t first_page,
ulint  offset,
ulint  len,
byte buf 
)
static

Replace a small portion of large object (LOB) with the given new data of equal length.

Parameters
[in]ctxreplace operation context.
[in]trxthe transaction that is doing the read.
[in]indexthe clustered index containing the LOB.
[in]refthe LOB reference identifying the LOB.
[in]first_pagethe first page of the LOB.
[in]offsetreplace the LOB from the given offset.
[in]lenthe length of LOB data that needs to be replaced.
[in]bufthe buffer (owned by caller) with new data (len bytes).
Returns
DB_SUCCESS on success, error code on failure.

◆ rollback()

static void lob::rollback ( DeleteContext ctx,
dict_index_t index,
trx_id_t  trxid,
undo_no_t  undo_no,
ulint  rec_type,
const upd_field_t uf 
)
static

Rollback modification of a uncompressed LOB.

Parameters
[in]ctxthe delete operation context information.
[in]indexclustered index in which LOB is present
[in]trxidthe transaction that is being rolled back.
[in]undo_noduring rollback to savepoint, rollback only up to this undo number.
[in]rec_typeundo record type.
[in]ufupdate vector of the concerned field.

◆ rollback_from_undolog()

static void lob::rollback_from_undolog ( DeleteContext ctx,
dict_index_t index,
const upd_field_t uf 
)
static

Rollback from undo log information.

Parameters
[in]ctxthe delete operation context.
[in]indexthe clustered index to which LOB belongs.
[in]ufthe update vector of concerned field.

◆ update() [1/2]

dberr_t lob::update ( InsertContext ctx,
trx_t trx,
dict_index_t index,
const upd_t upd,
ulint  field_no,
ref_t  blobref 
)

Update a portion of the given LOB.

Parameters
[in]ctxupdate operation context information.
[in]trxthe transaction that is doing the modification.
[in]indexthe clustered index containing the LOB.
[in]updupdate vector
[in]field_nothe LOB field number
[in]blobrefLOB reference stored in clust record.
Returns
DB_SUCCESS on success, error code on failure.

◆ update() [2/2]

dberr_t lob::update ( trx_t trx,
dict_index_t index,
const upd_t upd,
ulint  field_no 
)

Update a portion of the given LOB.

Parameters
[in]trxthe transaction that is doing the modification.
[in]indexthe clustered index containing the LOB.
[in]updupdate vector
[in]field_nothe LOB field number
Returns
DB_SUCCESS on success, error code on failure.

◆ validate_size()

bool lob::validate_size ( const ulint  lob_size,
dict_index_t index,
fil_addr_t  node_loc,
mtr_t mtr 
)

Validate the size of the given LOB.

Parameters
[in]lob_sizeExpected size of the LOB, mostly obtained from the LOB reference.
[in]indexClustered index containing the LOB.
[in]node_locLocation of the first LOB index entry.
[in]mtrMini-transaction context.
Returns
true if size is valid, false otherwise.

◆ z_find_offset()

fil_addr_t lob::z_find_offset ( dict_index_t index,
fil_addr_t  node_loc,
ulint offset,
mtr_t mtr 
)

Find the location of the given offset within LOB.

Parameters
[in]indexThe index where LOB is located.
[in]node_locThe location of first page.
[in,out]offsetThe requested offset.
[in]mtrMini-transaction context.
Returns
the file address of requested offset or fil_addr_null.

◆ z_import()

void lob::z_import ( const dict_index_t index,
byte field_ref,
trx_id_t  trx_id 
)

Import the given LOB.

Update the creator trx id and the modifier trx id to the given import trx id.

Parameters
[in]indexclustered index containing the lob.
[in]field_refthe lob reference.
[in]trx_idthe import trx id.

◆ z_insert()

dberr_t lob::z_insert ( InsertContext ctx,
trx_t trx,
ref_t ref,
big_rec_field_t field,
ulint  field_j 
)

Insert a compressed large object (LOB) into the system.

Parameters
[in]ctxthe B-tree context for this LOB operation.
[in]trxtransaction doing the insertion.
[in,out]refthe LOB reference.
[in]fieldthe LOB field.
[in]field_jthe LOB field index in big rec vector.
Returns
DB_SUCCESS on success, error code on failure.

◆ z_insert_chunk()

dberr_t lob::z_insert_chunk ( dict_index_t index,
z_first_page_t first,
trx_t trx,
byte blob,
ulint  len,
z_index_entry_t out_entry,
mtr_t mtr,
bool  bulk 
)

Insert one chunk of input.

The maximum size of a chunk is Z_CHUNK_SIZE.

Parameters
[in]indexClustered index in which LOB is inserted.
[in]firstFirst page of the LOB.
[in]trxTransaction doing the insertion.
[in]blobUncompressed LOB to be inserted.
[in]lenLength of the blob.
[out]out_entryNewly inserted index entry. can be NULL.
[in]mtrMini-transaction
[in]bulktrue if it is bulk operation, false otherwise.
Returns
DB_SUCCESS on success, error code on failure.

◆ z_insert_strm()

dberr_t lob::z_insert_strm ( dict_index_t index,
z_first_page_t first,
trx_id_t  trxid,
byte blob,
ulint  len,
mtr_t mtr,
bool  bulk,
page_no_t start_page_no,
frag_id_t frag_id 
)

Insert a single zlib stream.

Parameters
[in]indexthe index to which the LOB belongs.
[in]firstthe first page of the compressed LOB.
[in]trxidthe id of the current transaction.
[in]blobin memory copy of the LOB.
[in]lenthe length of the LOB.
[in]mtrthe mini-transaction context.
[in]bulktrue if bulk operation, false otherwise.
[out]start_page_nothe first page into which zlib stream was written.
[out]frag_idthe fragment id that contains last part of the zlib stream.
Returns
DB_SUCCESS on success, error code on error.

◆ z_print_info()

dberr_t lob::z_print_info ( const dict_index_t index,
const lob::ref_t ref,
std::ostream &  out 
)

Print information about the given compressed lob.

Parameters
[in]indexthe index dictionary object.
[in]refthe LOB reference
[out]outthe output stream where information is printed.
Returns
DB_SUCCESS on success, or an error code.

◆ z_print_partial_update_hit()

static void lob::z_print_partial_update_hit ( upd_field_t uf,
dict_index_t index 
)
static

Print an information message in the server log file, informing that the ZLOB partial update feature code is hit.

Parameters
[in]ufthe update field information
[in]indexindex where partial update happens.

◆ z_purge()

static void lob::z_purge ( DeleteContext ctx,
dict_index_t index,
trx_id_t  trxid,
undo_no_t  undo_no,
ulint  rec_type,
purge_node_t purge_node 
)
static

Purge a compressed LOB.

Parameters
[in]ctxThe delete operation context information.
[in]indexClustered index in which LOB is present
[in]trxidThe transaction that is being purged.
[in]undo_noDuring rollback to savepoint, purge only up to this undo number.
[in]rec_typeUndo record type.
[in,out]purge_nodeif nullptr, free the complete LOB. Otherwise, save the first page of LOB in this purge node.

◆ z_read() [1/2]

ulint lob::z_read ( lob::ReadContext ctx,
lob::ref_t  ref,
ulint  offset,
ulint  len,
byte buf 
)

Fetch a compressed large object (ZLOB) from the system.

Parameters
[in]ctxthe read context information.
[in]refthe LOB reference identifying the LOB.
[in]offsetread the LOB from the given offset.
[in]lenthe length of LOB data that needs to be fetched.
[out]bufthe output buffer (owned by caller) of minimum len bytes.
Returns
the amount of data (in bytes) that was actually read.

◆ z_read() [2/2]

ulint lob::z_read ( ReadContext ctx,
trx_t trx,
lob::ref_t  ref,
ulint  offset,
ulint  len,
byte buf 
)

Fetch a compressed large object (ZLOB) from the system.

Parameters
[in]ctxthe read context information.
[in]trxthe transaction that is doing the read.
[in]refthe LOB reference identifying the LOB.
[in]offsetread the LOB from the given offset.
[in]lenthe length of LOB data that needs to be fetched.
[out]bufthe output buffer (owned by caller) of minimum len bytes.
Returns
the amount of data (in bytes) that was actually read.

◆ z_read_chunk()

ulint lob::z_read_chunk ( dict_index_t index,
z_index_entry_t entry,
ulint  offset,
ulint len,
byte *&  buf,
mtr_t mtr 
)

Read one data chunk associated with one index entry.

Parameters
[in]indexThe clustered index containing the LOB.
[in]entryPointer to the index entry
[in]offsetThe offset from which to read the chunk.
[in,out]lenThe length of the output buffer. This length can be greater than the chunk size.
[in,out]bufThe output buffer.
[in]mtrMini-transaction context.
Returns
number of bytes copied into the output buffer.

◆ z_read_strm()

ulint lob::z_read_strm ( dict_index_t index,
z_index_entry_t entry,
byte zbuf,
ulint  zbuf_size,
mtr_t mtr 
)

Read one zlib stream fully, given its index entry.

Parameters
[in]indexThe index dictionary object.
[in]entryThe index entry (memory copy).
[in,out]zbufThe output buffer
[in]zbuf_sizeThe size of the output buffer.
[in,out]mtrMini-transaction.
Returns
the size of the zlib stream.

◆ z_replace()

static dberr_t lob::z_replace ( InsertContext ctx,
trx_t trx,
dict_index_t index,
ref_t  ref,
z_first_page_t first_page,
ulint  offset,
ulint  len,
byte buf 
)
static

Replace a large object (LOB) with the given new data.

Parameters
[in]ctxreplace operation context.
[in]trxthe transaction that is doing the read.
[in]indexthe clust index that contains the LOB.
[in]refthe LOB reference identifying the LOB.
[in]first_pagethe first page of the LOB.
[in]offsetreplace the LOB from the given offset.
[in]lenthe length of LOB data that needs to be replaced.
[in]bufthe buffer (owned by caller) with new data (len bytes).
Returns
DB_SUCCESS on success, error code on failure.

◆ z_rollback()

static void lob::z_rollback ( DeleteContext ctx,
dict_index_t index,
trx_id_t  trxid,
undo_no_t  undo_no,
ulint  rec_type 
)
static

Rollback modification of a compressed LOB.

Parameters
[in]ctxthe delete operation context information.
[in]indexclustered index in which LOB is present
[in]trxidthe transaction that is being rolled back.
[in]undo_noduring rollback to savepoint, rollback only up to this undo number.
[in]rec_typeundo record type.

◆ z_update() [1/2]

dberr_t lob::z_update ( InsertContext ctx,
trx_t trx,
dict_index_t index,
const upd_t upd,
ulint  field_no,
ref_t  blobref 
)

Update a portion of the given LOB.

Parameters
[in]ctxupdate operation context information.
[in]trxthe transaction that is doing the modification.
[in]indexthe clustered index containing the LOB.
[in]updupdate vector
[in]field_nothe LOB field number
[in]blobrefLOB reference stored in clust record.
Returns
DB_SUCCESS on success, error code on failure.

◆ z_update() [2/2]

dberr_t lob::z_update ( trx_t trx,
dict_index_t index,
const upd_t upd,
ulint  field_no 
)

Update a portion of the given LOB.

Parameters
[in]trxthe transaction that is doing the modification.
[in]indexthe clustered index containing the LOB.
[in]updupdate vector
[in]field_nothe LOB field number
Returns
DB_SUCCESS on success, error code on failure.

◆ z_validate_strm()

bool lob::z_validate_strm ( dict_index_t index,
z_index_entry_t entry,
mtr_t mtr 
)

Validate one zlib stream, given its index entry.

Parameters
[in]indexThe index dictionary object.
[in]entryThe index entry (memory copy).
[in]mtrMini-transaction.
Returns
true if validation passed.
does not return if validation failed.

◆ z_validate_strm_low()

static bool lob::z_validate_strm_low ( dict_index_t index,
z_index_entry_t entry,
mtr_t mtr 
)
static

Variable Documentation

◆ BTR_EXTERN_BEING_MODIFIED_FLAG

const ulint lob::BTR_EXTERN_BEING_MODIFIED_FLAG = 32UL

If the 3rd most significant bit of BTR_EXTERN_LEN is 1, then it means that the externally stored field is currently being modified.

This is mainly used by the READ UNCOMMITTED transaction to avoid returning inconsistent blob data.

◆ BTR_EXTERN_INHERITED_FLAG

const ulint lob::BTR_EXTERN_INHERITED_FLAG = 64UL

If the second most significant bit of BTR_EXTERN_LEN (i.e., the second most significant bit of the byte at smallest address) is 1 then it means that the externally stored field was inherited from an earlier version of the row.

In rollback we are not allowed to free an inherited external field.

◆ BTR_EXTERN_LEN

const ulint lob::BTR_EXTERN_LEN = 12

8 bytes containing the length of the externally stored part of the LOB.

The 2 highest bits are reserved to the flags below.

◆ BTR_EXTERN_OFFSET

const ulint lob::BTR_EXTERN_OFFSET = 8

offset of BLOB header on that page

◆ BTR_EXTERN_OWNER_FLAG

const ulint lob::BTR_EXTERN_OWNER_FLAG = 128UL

The most significant bit of BTR_EXTERN_LEN (i.e., the most significant bit of the byte at smallest address) is set to 1 if this field does not 'own' the externally stored field; only the owner field is allowed to free the field in purge!

◆ BTR_EXTERN_PAGE_NO

const ulint lob::BTR_EXTERN_PAGE_NO = 4

page number where stored

◆ BTR_EXTERN_SPACE_ID

const ulint lob::BTR_EXTERN_SPACE_ID = 0

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. Space identifier where stored.

◆ BTR_EXTERN_VERSION

const ulint lob::BTR_EXTERN_VERSION = BTR_EXTERN_OFFSET

Version number of LOB (LOB in new format)

◆ field_ref_almost_zero

const byte lob::field_ref_almost_zero
Initial value:
= {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x20, 0, 0, 0, 0, 0, 0, 0,
}

A BLOB field reference has all the bits set to zero, except the "being modified" bit.

◆ FRAG_ID_NULL

const ulint lob::FRAG_ID_NULL = std::numeric_limits<uint16_t>::max()

◆ KB128

constexpr uint32_t lob::KB128 = 128 * 1024
constexpr

The compressed LOB is stored as a collection of zlib streams.

The uncompressed LOB is divided into chunks of size Z_CHUNK_SIZE and each of these chunks are compressed individually and stored as compressed LOB. data.

◆ KB16

const ulint lob::KB16 = 16 * 1024

◆ LOB_HDR_NEXT_PAGE_NO

const ulint lob::LOB_HDR_NEXT_PAGE_NO = 4

Offset within header of next BLOB part page no.

FIL_NULL if none

◆ LOB_HDR_PART_LEN

const ulint lob::LOB_HDR_PART_LEN = 0

The structure of uncompressed LOB page header.

Offset within header of LOB length on this page.

◆ LOB_HDR_SIZE

const ulint lob::LOB_HDR_SIZE = 8

Size of an uncompressed LOB page header, in bytes.

◆ MAX_PARTIAL_UPDATE_LIMIT

const uint32_t lob::MAX_PARTIAL_UPDATE_LIMIT = 1000

Number of times an LOB can be partially updated.

Once this limit is reached, then the LOB will be fully updated.

◆ MAX_SIZE

const ulint lob::MAX_SIZE = UINT32_MAX

The maximum size possible for an LOB.

◆ Z_CHUNK_SIZE

constexpr uint32_t lob::Z_CHUNK_SIZE = KB128
constexpr

◆ ZLOB_PAGE_DATA

const uint lob::ZLOB_PAGE_DATA = FIL_PAGE_DATA

Start of the data on an LOB page.