90constexpr uint32_t
KB128 = 128 * 1024;
229 const ulint lob_length [[maybe_unused]]) {
308 byte_val &= ~BTR_EXTERN_OWNER_FLAG;
326 byte_val &= ~BTR_EXTERN_BEING_MODIFIED_FLAG;
360 byte_val &= ~BTR_EXTERN_INHERITED_FLAG;
473 ut_ad(mtr !=
nullptr);
481 ut_ad(block !=
nullptr);
514 bool &is_partially_updatable)
const;
519 std::ostream &
print(std::ostream &out)
const;
535 return (obj.
print(out));
608 size_t *ver,
bool is_sdi [[maybe_unused]],
mem_heap_t *heap) {
610 trx, index, rec, offsets, page_size, no, len, ver,
736 data =
const_cast<byte *
>(
750 ref.set_owner(val,
nullptr);
770 for (
ulint i = 0; i <
n; i++) {
848 table()->is_intrinsic());
852 table()->is_intrinsic());
869 ref_t blobref(field_ref);
913#ifndef UNIV_HOTBACKUP
1033 if (
m_rec !=
nullptr) {
1143 std::ostream &
print(std::ostream &out)
const;
1170 return (obj.
print(out));
1181 std::ostream &
print(std::ostream &out)
const;
1204 return (obj.
print(out));
1419 if (clust_rec ==
nullptr) {
1430 if (clust_rec !=
nullptr) {
1471 using Block_vector = std::vector<buf_block_t *, ut::allocator<buf_block_t *>>;
1487 m_blobref(field_ref),
1488 m_field_no(field_no),
1490 m_page_size(table() ==
nullptr ? get_page_size()
1492 if (field_ref !=
nullptr) {
1500 if (field_ref !=
nullptr) {
1590 const page_size_t &page_size,
const byte *data,
bool is_sdi,
1593 trx, index,
buf, len, page_size, data,
IF_DEBUG(is_sdi, ) local_len);
1600 page_size, local_len,
1635 const upd_t *upd,
ulint field_no, ref_t blobref);
1647 const upd_t *upd,
ulint field_no, ref_t blobref);
1680 const ulint *offsets);
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:51
uint32_t page_no_t
Page number.
Definition: api0api.h:49
void btr_page_free_low(dict_index_t *index, buf_block_t *block, ulint level, mtr_t *mtr)
Frees a file page used in an index tree.
Definition: btr0btr.cc:528
static buf_block_t * btr_block_get(const page_id_t &page_id, const page_size_t &page_size, ulint mode, ut::Location location, const dict_index_t *index, mtr_t *mtr)
Gets a buffer page and declares its latching order level.
Definition: btr0btr.h:200
The index tree persistent cursor.
@ BTR_PCUR_ON
Definition: btr0pcur.h:53
constexpr uint32_t BTR_EXTERN_FIELD_REF_SIZE
The size of a reference to data stored on a different page.
Definition: btr0types.h:66
static buf_frame_t * buf_block_get_frame(const buf_block_t *block)
Gets a pointer to the memory frame of a block.
page_zip_des_t * buf_block_get_page_zip(buf_block_t *block) noexcept
Gets the compressed page descriptor corresponding to an uncompressed page if applicable.
Definition: buf0buf.h:2623
void buf_block_buf_fix_inc(buf_block_t *b, ut::Location l)
Increments the bufferfix count.
Definition: buf0buf.h:588
static void buf_block_buf_fix_dec(buf_block_t *block)
Decrements the bufferfix count.
Definition: buf0buf.ic:804
We use Flush_observer to track flushing of non-redo logged pages in bulk create index(btr0load....
Definition: buf0flu.h:269
Definition: buf0buf.h:1125
buf_fix_count_atomic_t buf_fix_count
Count of how many fold this block is currently bufferfixed.
Definition: buf0buf.h:1325
The B-tree context under which the LOB operation is done.
Definition: lob0lob.h:654
void set_ownership_of_extern_field(ulint i, bool val)
Sets the ownership bit of an externally stored field in a record.
Definition: lob0lob.h:732
void start_btr_mtr()
Start the mini-transaction that will be holding the latches of the clustered index record block.
Definition: lob0lob.h:901
void unmark_extern_fields()
Marks all extern fields in a record as owned by the record.
Definition: lob0lob.h:761
mtr_t * get_mtr()
Get the associated mini-transaction.
Definition: lob0lob.h:1041
buf_block_t * block() const
Get the pointer to the clustered record block.
Definition: lob0lob.h:1045
void check_redolog_normal()
Check if there is enough space in log file.
Definition: lob0lob.cc:113
void make_nth_extern(ulint field_no)
Mark the nth field as externally stored.
Definition: lob0lob.h:1012
const page_t * rec_frame() const
Get the beginning of the B-tree clustered index page frame that contains the current clustered index ...
Definition: lob0lob.h:890
BtrContext(const BtrContext &other)
Copy Constructor.
Definition: lob0lob.h:712
void zblob_write_blobref(ulint field_no, mtr_t *mtr)
Write a blob reference of a field into a clustered index record in a compressed leaf page.
Definition: lob0lob.h:1074
void recalc()
Recalculate some of the members after restoring the persistent cursor.
Definition: lob0lob.h:1060
void store_position()
Save the position of the persistent cursor.
Definition: lob0lob.h:1048
mtr_t * m_mtr
The btr mtr that is holding the latch on the B-tree index page containing the clustered index record.
Definition: lob0lob.h:1081
bool are_all_blobrefs_valid() const
Check to see if all pointers to externally stored columns in the record must be valid.
Definition: lob0lob.h:861
void restore_position()
Restore the position of the persistent cursor.
Definition: lob0lob.h:962
BtrContext(mtr_t *mtr, btr_pcur_t *pcur, dict_index_t *index, rec_t *rec, ulint *offsets, buf_block_t *block, opcode op)
Constructor.
Definition: lob0lob.h:696
mtr_log_t get_log_mode()
Get the log mode of the btr mtr.
Definition: lob0lob.h:1018
dict_table_t * table() const
Get the table object.
Definition: lob0lob.h:978
ulint get_rec_offset() const
Get the record offset within page of the clustered index record.
Definition: lob0lob.h:815
opcode m_op
Definition: lob0lob.h:1089
space_id_t space() const
Get the space id.
Definition: lob0lob.h:990
page_no_t get_btr_page_no() const
Get the page number of clustered index record.
Definition: lob0lob.h:909
Flush_observer * get_flush_observer() const
Get flush observer.
Definition: lob0lob.h:1022
page_no_t get_page_no() const
Get the page number of clustered index block.
Definition: lob0lob.h:809
buf_block_t * m_block
Definition: lob0lob.h:1088
rec_t * rec() const
Get the clustered index record pointer.
Definition: lob0lob.h:825
void free_updated_extern_fields(trx_id_t trx_id, undo_no_t undo_no, const upd_t *update, bool rollback, big_rec_t *big_rec_vec)
Frees the externally stored fields for a record, if the field is mentioned in the update vector.
Definition: lob0lob.cc:957
void check_redolog()
Check if there is enough space in the redo log file.
Definition: lob0lob.h:1006
page_no_t pages_in_extent() const
Determine the extent size (in pages) for the underlying table.
Definition: lob0lob.h:1000
void disown_inherited_fields(const upd_t *update)
Marks non-updated off-page fields as disowned by this record.
Definition: lob0lob.cc:75
void commit_btr_mtr()
Commit the mini-transaction that is holding the latches of the clustered index record block.
Definition: lob0lob.h:897
ulint m_rec_offset
Record offset within the page.
Definition: lob0lob.h:1092
void check_redolog_bulk()
When bulk load is being done, check if there is enough space in redo log file.
Definition: lob0lob.cc:91
ulint * m_offsets
Definition: lob0lob.h:1087
dict_index_t * m_index
Definition: lob0lob.h:1085
rec_t * m_rec
Definition: lob0lob.h:1086
BtrContext(mtr_t *mtr, dict_index_t *index, buf_block_t *block)
Constructor.
Definition: lob0lob.h:668
page_no_t m_btr_page_no
Page number where the clust rec is present.
Definition: lob0lob.h:1095
void free_externally_stored_fields(trx_id_t trx_id, undo_no_t undo_no, bool rollback, ulint rec_type, purge_node_t *node)
Frees the externally stored fields for a record.
Definition: lob0lob.cc:1098
ulint * get_offsets() const
Get the record offsets array.
Definition: lob0lob.h:1028
BtrContext()
Default Constructor.
Definition: lob0lob.h:657
void rec_block_fix()
Increment the buffer fix count of the clustered index record block.
Definition: lob0lob.h:924
byte * get_field_ref(ulint field_no) const
Get the LOB reference for the given field number.
Definition: lob0lob.h:833
BtrContext(mtr_t *mtr, btr_pcur_t *pcur, dict_index_t *index, rec_t *rec, ulint *offsets, buf_block_t *block)
Constructor.
Definition: lob0lob.h:679
bool need_recalc() const
Check if there is a need to recalculate the context information.
Definition: lob0lob.h:819
btr_pcur_t * m_pcur
Persistent cursor positioned on the clustered index record.
Definition: lob0lob.h:1084
bool validate() const
Validate the current BLOB context object.
Definition: lob0lob.h:843
void rec_block_unfix()
Decrement the buffer fix count of the clustered index record block, X-latching it before,...
Definition: lob0lob.h:939
bool is_bulk() const
Determine whether current operation is a bulk insert operation.
Definition: lob0lob.h:885
dict_index_t * index() const
Get the index object.
Definition: lob0lob.h:974
bool rec_offs_validate() const
Validate the record offsets array.
Definition: lob0lob.h:1032
const page_size_t page_size() const
Obtain the page size of the underlying table.
Definition: lob0lob.h:994
page_zip_des_t * get_page_zip() const
Gets the compressed page descriptor.
Definition: lob0lob.h:803
Page identifier.
Definition: buf0types.h:207
Page size descriptor.
Definition: page0size.h:50
bool is_compressed() const
Check whether the page is compressed on disk.
Definition: page0size.h:158
int page
Definition: ctype-mb.cc:1236
dberr_t
Definition: db0err.h:39
@ DB_SUCCESS
Definition: db0err.h:43
page_no_t dict_table_extent_size(const dict_table_t *table)
Determine the extent size (in pages) for the given table.
Definition: dict0dict.cc:5025
static const page_size_t dict_table_page_size(const dict_table_t *table)
Get the table page size.
static rw_lock_t * dict_index_get_lock(dict_index_t *index)
Gets the read-write lock of the index tree.
Data dictionary memory object creation.
uint32_t DICT_TF_HAS_ATOMIC_BLOBS(uint32_t flags)
Return the value of the ATOMIC_BLOBS field.
Definition: dict0mem.h:238
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
uint32_t fil_space_get_flags(space_id_t space_id)
Returns the flags of the space.
Definition: fil0fil.cc:3528
const page_size_t fil_space_get_page_size(space_id_t space_id, bool *found)
Returns the page size of the space and whether it is compressed or not.
Definition: fil0fil.cc:3595
constexpr page_no_t FIL_NULL
'null' (undefined) page offset in the context of file spaces
Definition: fil0fil.h:1131
constexpr uint32_t FIL_PAGE_DATA
start of the data on the page
Definition: fil0types.h:111
static int flags[50]
Definition: hp_test1.cc:40
#define UINT32_MAX
Definition: lexyy.cc:86
unsigned char byte
Blob class.
Definition: common.h:151
std::map< page_no_t, buf_block_t * > BlockCache
Definition: lob0lob.h:42
static uint32_t mach_read_from_4(const byte *b)
The following function is used to fetch data from 4 consecutive bytes.
static uint8_t mach_read_from_1(const byte *b)
The following function is used to fetch data from one byte.
void mlog_write_ulint(byte *ptr, ulint val, mlog_id_t type, mtr_t *mtr)
Writes 1, 2 or 4 bytes to a file page.
Definition: mtr0log.cc:256
#define mtr_memo_contains_flagged(m, p, l)
Definition: mtr0mtr.h:137
#define mtr_x_lock(l, m, loc)
Lock an rw-lock in x-mode.
Definition: mtr0mtr.h:129
@ MLOG_4BYTES
4 bytes ...
Definition: mtr0types.h:76
@ MLOG_1BYTE
one byte is written
Definition: mtr0types.h:70
mtr_log_t
Logging modes for a mini-transaction.
Definition: mtr0types.h:42
@ MTR_LOG_NO_REDO
Don't generate REDO log but add dirty pages to flush list.
Definition: mtr0types.h:50
@ MTR_MEMO_X_LOCK
Definition: mtr0types.h:285
@ MTR_MEMO_PAGE_X_FIX
Definition: mtr0types.h:273
@ MTR_MEMO_SX_LOCK
Definition: mtr0types.h:287
@ MTR_MEMO_PAGE_SX_FIX
Definition: mtr0types.h:275
Definition: buf0block_hint.cc:30
PT & ref(PT *tp)
Definition: tablespace_impl.cc:359
Provides the large objects (LOB) module.
Definition: lob0del.h:32
const ulint BTR_EXTERN_OWNER_FLAG
The most significant bit of BTR_EXTERN_LEN (i.e., the most significant bit of the byte at smallest ad...
Definition: lob0lob.h:123
const ulint BTR_EXTERN_SPACE_ID
The reference in a field for which data is stored on a different page.
Definition: lob0lob.h:102
const ulint BTR_EXTERN_PAGE_NO
page number where stored
Definition: lob0lob.h:105
const ulint BTR_EXTERN_BEING_MODIFIED_FLAG
If the 3rd most significant bit of BTR_EXTERN_LEN is 1, then it means that the externally stored fiel...
Definition: lob0lob.h:136
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.
Definition: lob0purge.cc:65
byte * 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.
Definition: lob0lob.cc:876
const ulint LOB_HDR_SIZE
Size of an uncompressed LOB page header, in bytes.
Definition: lob0lob.h:148
const ulint BTR_EXTERN_LEN
8 bytes containing the length of the externally stored part of the LOB.
Definition: lob0lob.h:115
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.
Definition: lob0lob.cc:1272
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.
static byte * 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)
Definition: lob0lob.h:1595
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.
Definition: lob0lob.cc:1312
const ulint BTR_EXTERN_VERSION
Version number of LOB (LOB in new format)
Definition: lob0lob.h:111
const ulint MAX_SIZE
The maximum size possible for an LOB.
Definition: lob0lob.h:84
opcode
LOB operation code for btr_store_big_rec_extern_fields().
Definition: lob0lob.h:539
@ OPCODE_UPDATE
Store off-page columns for an update.
Definition: lob0lob.h:548
@ OPCODE_INSERT
Store off-page columns for a freshly inserted record.
Definition: lob0lob.h:542
@ OPCODE_INSERT_UPDATE
Store off-page columns for an insert by update.
Definition: lob0lob.h:545
@ OPCODE_UNKNOWN
The operation code is unknown or not important.
Definition: lob0lob.h:554
@ OPCODE_INSERT_BULK
Store off-page columns for a freshly inserted record by bulk.
Definition: lob0lob.h:551
void z_import(const dict_index_t *index, byte *field_ref, trx_id_t trx_id)
Import the given LOB.
void print(trx_t *trx, dict_index_t *index, std::ostream &out, ref_t ref, bool fatal)
Print information about the given LOB.
Definition: lob0impl.cc:1331
const ulint LOB_HDR_NEXT_PAGE_NO
Offset within header of next BLOB part page no.
Definition: lob0lob.h:145
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).
Definition: lob0purge.cc:414
static byte * 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)
Definition: lob0lob.h:605
dberr_t update(trx_t *trx, dict_index_t *index, const upd_t *upd, ulint field_no)
Update a portion of the given LOB.
const ulint BTR_EXTERN_INHERITED_FLAG
If the second most significant bit of BTR_EXTERN_LEN (i.e., the second most significant bit of the by...
Definition: lob0lob.h:130
static const byte * btr_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.
Definition: lob0lob.h:628
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.
Definition: lob0lob.cc:1063
byte * 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.
Definition: lob0lob.cc:635
constexpr uint32_t Z_CHUNK_SIZE
Definition: lob0lob.h:91
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.
Definition: lob0lob.cc:46
const uint ZLOB_PAGE_DATA
Start of the data on an LOB page.
Definition: lob0lob.h:151
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.
Definition: lob0lob.cc:1023
bool btr_lob_op_is_update(opcode op)
Determine if an operation on off-page columns is an update.
Definition: lob0lob.h:1531
const ulint BTR_EXTERN_OFFSET
offset of BLOB header on that page
Definition: lob0lob.h:108
const ulint LOB_HDR_PART_LEN
The structure of uncompressed LOB page header.
Definition: lob0lob.h:141
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.
Definition: lob0lob.cc:812
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.
Definition: lob0lob.cc:410
std::ostream & operator<<(std::ostream &out, const plist_node_t &obj)
Definition: lob0impl.h:239
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)
Definition: lob0lob.h:1588
constexpr uint32_t KB128
The compressed LOB is stored as a collection of zlib streams.
Definition: lob0lob.h:90
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.
Definition: lob0lob.cc:57
static bool page_rec_is_comp(const rec_t *rec)
true if the record is on a page in compact format.
static page_no_t page_get_page_no(const page_t *page)
Gets the page number.
static ulint page_offset(const void *ptr)
Gets the offset within a page.
static page_t * page_align(const void *ptr)
Gets the start of a page.
constexpr size_t FIELD_REF_SIZE
Definition: page0size.h:39
const byte field_ref_zero[FIELD_REF_SIZE]
A BLOB field reference full of zero, for use in assertions and tests.Initially, BLOB field references...
Definition: page0zip.cc:42
byte page_t
Type of the index page.
Definition: page0types.h:152
void page_zip_write_blob_ptr(page_zip_des_t *page_zip, const byte *rec, const dict_index_t *index, const ulint *offsets, ulint n, mtr_t *mtr)
Write a BLOB pointer of a record on the leaf page of a clustered index.
Definition: page0zip.cc:1878
static void rec_offs_make_valid(const rec_t *rec, const dict_index_t *index, ulint *offsets)
Updates debug data in offsets, in order to avoid bogus rec_offs_validate() failures.
Definition: rec.h:600
static ulint rec_offs_n_fields(const ulint *offsets)
The following function returns the number of fields in a record.
Definition: rec.h:484
static bool rec_get_node_ptr_flag(const rec_t *rec)
The following function tells if a new-style record is a node pointer.
static bool rec_get_deleted_flag(const rec_t *rec, bool comp)
The following function tells if record is delete marked.
static bool rec_offs_any_extern(const ulint *offsets)
Determine if the offsets are for a record containing externally stored columns.
static bool rec_offs_comp(const ulint *offsets)
Determine if the offsets are for a record in the new compact format.
byte rec_t
Definition: rem0types.h:41
void rec_offs_make_nth_extern(dict_index_t *index, ulint *offsets, ulint n)
Mark the nth field as externally stored.
Definition: rem0wrec.cc:147
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.
Definition: rem0wrec.cc:81
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.
Definition: rem0wrec.cc:137
Modification log for online index creation and online table rebuild.
Storage format for overflow data in a big record, that is, a clustered index record which needs exter...
Definition: data0data.h:830
ulint n_fields
number of stored fields
Definition: data0data.h:834
page_cur_t page_cur
Page cursor.
Definition: btr0cur.h:672
Definition: btr0pcur.h:99
bool restore_position(ulint latch_mode, mtr_t *mtr, ut::Location location)
Restores the stored position of a persistent cursor bufferfixing the page and obtaining the specified...
Definition: btr0pcur.cc:147
btr_pcur_pos_t m_rel_pos
BTR_PCUR_ON, BTR_PCUR_BEFORE, or BTR_PCUR_AFTER, depending on whether cursor was on,...
Definition: btr0pcur.h:470
dict_index_t * index()
Definition: btr0pcur.h:106
buf_block_t * get_block()
Returns the current buffer block (non const version).
Definition: btr0pcur.h:656
ulint m_latch_mode
see TODO note below! BTR_SEARCH_LEAF, BTR_MODIFY_LEAF, BTR_MODIFY_TREE or BTR_NO_LATCHES,...
Definition: btr0pcur.h:456
btr_cur_t m_btr_cur
a B-tree cursor
Definition: btr0pcur.h:447
void store_position(mtr_t *mtr)
The position of the cursor is stored by taking an initial segment of the record the cursor is positio...
Definition: btr0pcur.cc:42
rec_t * get_rec()
Returns the current record (non const version).
Definition: btr0pcur.h:668
The buffer control block structure.
Definition: buf0buf.h:1690
buf_page_t page
page information; this must be the first field, so that buf_pool->page_hash can point to buf_page_t o...
Definition: buf0buf.h:1696
byte * frame
pointer to buffer frame which is of size UNIV_PAGE_SIZE, and aligned to an address divisible by UNIV_...
Definition: buf0buf.h:1706
Data structure for an index.
Definition: dict0mem.h:1046
dict_table_t * table
back pointer to table
Definition: dict0mem.h:1060
Data structure for a database table.
Definition: dict0mem.h:1909
The context information when the delete operation on LOB is taking place.
Definition: lob0lob.h:1380
bool is_ref_valid() const
Check if the blob reference is valid.
Definition: lob0lob.h:1401
bool is_compressed() const
Determine if it is compressed page format.
Definition: lob0lob.h:1407
page_size_t m_page_size
The page size of the tablespace.
Definition: lob0lob.h:1455
page_size_t get_page_size() const
Obtain the page size from the tablespace flags.
Definition: lob0lob.h:1505
~DeleteContext()
Destructor.
Definition: lob0lob.h:1513
bool m_rollback
Is this operation part of rollback?
Definition: lob0lob.h:1452
DeleteContext(const BtrContext &btr, byte *field_ref, ulint field_no, bool rollback)
Constructor.
Definition: lob0lob.h:1484
Block_vector m_lob_blocks
The buffer blocks of lob to be freed.
Definition: lob0lob.h:1474
bool is_delete_marked() const
Definition: lob0lob.h:1417
ref_mem_t m_blobref_mem
Memory copy of the original LOB reference.
Definition: lob0lob.h:1469
bool validate_blobref() const
Validate the LOB reference object.
Definition: lob0lob.h:1428
std::vector< buf_block_t *, ut::allocator< buf_block_t * > > Block_vector
Definition: lob0lob.h:1471
void x_latch_rec_page(mtr_t *mtr)
Acquire an x-latch on the index page containing the clustered index record, in the given mini-transac...
Definition: lob0lob.cc:1252
void set_blob(byte *field_ref, ulint field_no)
Update the delete context to point to a different blob.
Definition: lob0lob.h:1497
void add_lob_block(buf_block_t *block)
Add a buffer block that is to be freed.
Definition: lob0lob.h:1515
bool has_atomic_blobs() const
Check if tablespace supports atomic blobs.
Definition: lob0lob.h:1411
ref_t m_blobref
the BLOB reference or external field reference.
Definition: lob0lob.h:1446
void free_lob_blocks()
Free all the stored lob blocks.
Definition: lob0lob.h:1520
ulint m_field_no
field number of externally stored column; ignored if rec == NULL
Definition: lob0lob.h:1449
The context for a LOB operation.
Definition: lob0lob.h:1100
ulint get_big_rec_vec_size()
Get the size of vector containing fields to be stored externally.
Definition: lob0lob.h:1113
const big_rec_t * get_big_rec_vec()
Get the vector containing fields to be stored externally.
Definition: lob0lob.h:1109
const big_rec_t * m_big_rec_vec
The B-tree Context.
Definition: lob0lob.h:1119
InsertContext(const BtrContext &btr_ctx, const big_rec_t *big_rec_vec)
Constructor.
Definition: lob0lob.h:1104
The context information for reading a single BLOB.
Definition: lob0lob.h:1208
bool is_valid_blob() const
Check if the BLOB reference is valid.
Definition: lob0lob.h:1246
const byte * m_data
The 'internally' stored part of the field containing also the reference to the external part; must be...
Definition: lob0lob.h:1256
bool assert_read_uncommitted() const
Assert that current trx is using isolation level read uncommitted.
Definition: lob0lob.cc:51
dict_index_t * index()
Definition: lob0lob.h:1248
const ref_t m_blobref
The blob reference of the blob that is being read.
Definition: lob0lob.h:1263
ulint m_lob_version
Definition: lob0lob.h:1282
const bool m_is_sdi
Is it a tablespace dictionary index (SDI)?
Definition: lob0lob.h:1290
ulint m_local_len
Length (in bytes) of BLOB prefix stored inline in clustered index record.
Definition: lob0lob.h:1260
ulint m_offset
The offset information obtained from the blob reference.
Definition: lob0lob.h:1278
const page_size_t & m_page_size
The page size information.
Definition: lob0lob.h:1251
byte * m_buf
Buffer into which data is read.
Definition: lob0lob.h:1266
page_no_t m_page_no
The page number obtained from the blob reference.
Definition: lob0lob.h:1275
dict_index_t * m_index
Definition: lob0lob.h:1280
ulint m_len
Length of the buffer m_buf.
Definition: lob0lob.h:1269
space_id_t m_space_id
The identifier of the space in which blob is available.
Definition: lob0lob.h:1272
bool is_sdi() const
Is it a space dictionary index (SDI)?
Definition: lob0lob.h:1287
trx_t * m_trx
The transaction that is reading.
Definition: lob0lob.h:1298
void read_blobref()
Read the space_id, page_no and offset information from the BLOB reference object and update the membe...
Definition: lob0lob.h:1236
ReadContext(const page_size_t &page_size, const byte *data, ulint prefix_len, byte *buf, ulint len, bool is_sdi)
Constructor.
Definition: lob0lob.h:1221
Fetch uncompressed BLOB.
Definition: lob0lob.h:1355
ulint m_copied_len
Total bytes of LOB data that has been copied from multiple LOB pages.
Definition: lob0lob.h:1375
void fetch_page()
Fetch one BLOB page.
Definition: lob0lob.cc:738
ReadContext m_rctx
Definition: lob0lob.h:1367
buf_block_t * m_cur_block
Buffer block of the current BLOB page.
Definition: lob0lob.h:1370
ulint fetch()
Fetch the complete or prefix of the uncompressed LOB data.
Definition: lob0lob.cc:774
Reader(const ReadContext &ctx)
Constructor.
Definition: lob0lob.h:1357
The in-memory blob directory.
Definition: lob0lob.h:1175
std::vector< blob_page_info_t >::const_iterator const_iterator
Definition: lob0lob.h:1176
std::vector< blob_page_info_t > m_pages
A vector of blob pages along with its metadata.
Definition: lob0lob.h:1195
std::ostream & print(std::ostream &out) const
Print this blob directory into the given output stream.
Definition: lob0lob.cc:139
dberr_t add(const blob_page_info_t &page)
Append the given blob page information.
Definition: lob0lob.h:1189
void clear()
Clear the contents of this blob directory.
Definition: lob0lob.h:1184
Information about data stored in one BLOB page.
Definition: lob0lob.h:1123
page_no_t m_page_no
The BLOB page number.
Definition: lob0lob.h:1159
blob_page_info_t(page_no_t page_no, uint bytes, uint zbytes)
Constructor.
Definition: lob0lob.h:1130
uint m_zbytes
Amount of compressed data (in bytes) in the BLOB page.
Definition: lob0lob.h:1165
std::ostream & print(std::ostream &out) const
Print this blob_page_into_t object into the given output stream.
Definition: lob0lob.cc:151
void set_uncompressed_size(uint bytes)
Set the uncompressed data size in bytes.
Definition: lob0lob.h:1151
void set_page_no(page_no_t page_no)
Set the page number.
Definition: lob0lob.h:1155
uint m_bytes
Amount of uncompressed data (in bytes) in the BLOB page.
Definition: lob0lob.h:1162
void set_compressed_size(uint bytes)
Set the compressed data size in bytes.
Definition: lob0lob.h:1147
void reset()
Re-initialize the current object.
Definition: lob0lob.h:1134
In memory representation of the LOB reference.
Definition: lob0lob.h:154
bool m_partial
Whether the LOB is partially updated.
Definition: lob0lob.h:178
page_no_t m_page_no
Page number of first LOB page.
Definition: lob0lob.h:159
ulint m_offset
Offset within m_page_no where LOB begins.
Definition: lob0lob.h:162
bool m_inherit
Whether the clustered index record inherited this LOB from another clustered index record.
Definition: lob0lob.h:175
bool m_owner
Whether the clustered index record owns this LOB.
Definition: lob0lob.h:171
ulint m_length
Length of LOB.
Definition: lob0lob.h:165
bool m_null
Whether the LOB is null.
Definition: lob0lob.h:168
bool m_being_modified
Whether the blob is being modified.
Definition: lob0lob.h:181
space_id_t m_space_id
Space Identifier of the clustered index.
Definition: lob0lob.h:156
bool is_purged() const
Check if the LOB has already been purged.
Definition: lob0lob.h:185
The struct 'lob::ref_t' represents an external field reference.
Definition: lob0lob.h:198
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 s...
Definition: lob0lob.h:222
void set_page_no(const ulint page_no, mtr_t *mtr)
Set the page number in the external field reference.
Definition: lob0lob.h:442
void set_space_id(const space_id_t space_id, mtr_t *mtr)
Set the space_id in the external field reference.
Definition: lob0lob.h:435
void update(space_id_t space_id, ulint page_no, ulint offset, mtr_t *mtr)
Update the information stored in the external field reference.
Definition: lob0lob.h:426
void set_inherited(bool inherited, mtr_t *mtr)
Set the inherited flag in the field reference.
Definition: lob0lob.h:354
void parse(ref_mem_t &obj) const
Parse the LOB reference object and copy data into the given ref_mem_t object.
Definition: lob0lob.h:245
static bool is_null(const byte *ref)
Check if the LOB reference is null (all zeroes).
Definition: lob0lob.h:294
static const ulint LOB_BIG_THRESHOLD_SIZE
If the LOB size is equal to or above this limit (in physical page size terms), then the LOB is big en...
Definition: lob0lob.h:203
static const ulint LOB_SMALL_CHANGE_THRESHOLD
If the total number of bytes modified in an LOB, in an update operation, is less than or equal to thi...
Definition: lob0lob.h:210
static bool is_being_modified(const byte *field_ref)
Check if the current blob is being modified.
Definition: lob0lob.h:342
static const uint SIZE
The size of an LOB reference object (in bytes)
Definition: lob0lob.h:522
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.
Definition: lob0lob.cc:1240
void set_length(const ulint len, mtr_t *mtr)
Set the length of blob in the external field reference.
Definition: lob0lob.h:456
void set_owner(bool owner, mtr_t *mtr)
Set the ownership flag in the blob reference.
Definition: lob0lob.h:303
bool is_null() const
Check if the field reference is made of zeroes.
Definition: lob0lob.h:279
ulint length() const
Read the length from the blob reference.
Definition: lob0lob.h:417
ref_t(byte *ptr)
Constructor.
Definition: lob0lob.h:214
bool is_being_modified() const
Check if the current blob is being modified.
Definition: lob0lob.h:349
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 s...
Definition: lob0lob.h:218
bool is_lob_partially_updatable(const dict_index_t *index) const
Check if the LOB can be partially updated.
Definition: lob0lob.cc:1211
static space_id_t space_id(const byte *ref)
Read the space id from the given blob reference.
Definition: lob0lob.h:384
std::ostream & print(std::ostream &out) const
Print this LOB reference into the given output stream.
Definition: lob0lob.cc:1231
static void set_being_modified(byte *ref, bool modifying, mtr_t *mtr)
Set the being_modified flag in the field reference.
Definition: lob0lob.h:320
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.
Definition: lob0lob.h:228
ulint offset() const
Read the offset of blob header from the blob reference.
Definition: lob0lob.h:407
bool is_inherited() const
Check if the current row inherited the blob from parent row.
Definition: lob0lob.h:375
void copy(byte *field_ref) const
Copy the LOB reference into the given memory location.
Definition: lob0lob.h:259
byte * m_ref
Pointing to a memory of size BTR_EXTERN_FIELD_REF_SIZE.
Definition: lob0lob.h:526
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.
Definition: lob0lob.cc:1130
page_no_t page_no() const
Read the page number from the blob reference.
Definition: lob0lob.h:401
bool is_big(const page_size_t &page_size) const
Check if this LOB is big enough to do partial update.
Definition: lob0lob.h:237
void set_being_modified(bool modifying, mtr_t *mtr)
Set the being_modified flag in the field reference.
Definition: lob0lob.h:335
page_t * page_align() const
Get the start of a page containing this blob reference.
Definition: lob0lob.h:463
static bool is_null_relaxed(const byte *ref)
Check if the LOB reference is null (all zeroes) except the "is being modified" bit.
Definition: lob0lob.h:287
space_id_t space_id() const
Read the space id from the blob reference.
Definition: lob0lob.h:397
bool is_null_relaxed() const
Check if the field reference is made of zeroes except the being_modified bit.
Definition: lob0lob.h:273
bool validate(mtr_t *mtr)
Check if the given mtr has necessary latches to update this LOB reference.
Definition: lob0lob.h:471
bool is_equal(const byte *ptr) const
Check whether the stored external field reference is equal to the given field reference.
Definition: lob0lob.h:264
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.
Definition: lob0lob.cc:1172
bool is_owner() const
Check if the current row is the owner of the blob.
Definition: lob0lob.h:368
void set_ref(byte *ptr)
Set the external field reference to the given memory location.
Definition: lob0lob.h:268
void set_offset(const ulint offset, mtr_t *mtr)
Set the offset information in the external field reference.
Definition: lob0lob.h:449
uint32_t version() const
Read the LOB version from the blob reference.
Definition: lob0lob.h:411
static page_no_t page_no(const byte *ref)
Read the page no from the blob reference.
Definition: lob0lob.h:390
Fetch compressed BLOB.
Definition: lob0lob.h:1302
ulint length() const
Get the length of data that has been read.
Definition: lob0lob.h:1316
int setup_zstream()
Do setup of the zlib stream.
Definition: lob0lob.cc:159
dberr_t fetch()
Fetch the BLOB.
Definition: lob0lob.cc:178
zReader(const ReadContext &ctx)
Constructor.
Definition: lob0lob.h:1304
ulint m_page_type_ex
The expected page type.
Definition: lob0lob.h:1350
buf_page_t * m_bpage
Definition: lob0lob.h:1346
dberr_t fetch_page()
Fetch one BLOB page.
Definition: lob0lob.cc:255
mem_heap_t * m_heap
The memory heap that will be used by zlib allocator.
Definition: lob0lob.h:1340
z_stream m_stream
The zlib stream used to uncompress while fetching blob.
Definition: lob0lob.h:1337
ReadContext m_rctx
Definition: lob0lob.h:1331
bool assert_empty_local_prefix()
Assert that the local prefix is empty.
Definition: lob0lob.cc:249
ulint m_remaining
Bytes yet to be read.
Definition: lob0lob.h:1334
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:302
Mini-transaction handle and buffer.
Definition: mtr0mtr.h:177
Flush_observer * get_flush_observer() const
Get flush observer.
Definition: mtr0mtr.h:516
mtr_log_t set_log_mode(mtr_log_t mode)
Change the logging mode.
Definition: mtr0mtr.cc:471
void commit()
Commit the mini-transaction.
Definition: mtr0mtr.cc:662
mtr_log_t get_log_mode() const
Get the logging mode.
Definition: mtr0mtr.ic:153
void start(bool sync=true)
Start a mini-transaction.
Definition: mtr0mtr.cc:565
buf_block_t * memo_contains_page_flagged(const byte *ptr, ulint flags) const
Check if memo contains the given page.
Definition: mtr0mtr.cc:1076
Index page cursor.
Definition: page0cur.h:311
buf_block_t * block
Pointer to the current block containing rec.
Definition: page0cur.h:322
rec_t * rec
pointer to a record on page
Definition: page0cur.h:316
Compressed page descriptor.
Definition: page0types.h:200
Definition: row0purge.h:93
Definition: trx0trx.h:684
Definition: row0upd.h:467
Definition: row0upd.h:565
@ RW_X_LATCH
Definition: sync0rw.h:96
ib_id_t undo_no_t
Undo number.
Definition: trx0types.h:142
ib_id_t trx_id_t
Transaction identifier (DB_TRX_ID, DATA_TRX_ID)
Definition: trx0types.h:138
unsigned int uint
Definition: uca9-dump.cc:75
Version control for database, common definitions, and include files.
#define IF_DEBUG(...)
Definition: univ.i:674
unsigned long int ulint
Definition: univ.i:406
constexpr ulint ULINT_UNDEFINED
The 'undefined' value for a ulint.
Definition: univ.i:420
#define UT_LOCATION_HERE
Definition: ut0core.h:47
#define ut_error
Abort execution.
Definition: ut0dbg.h:65
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:69
#define ut_o(EXPR)
Opposite of ut_d().
Definition: ut0dbg.h:73
#define ut_d(EXPR)
Debug statement.
Definition: ut0dbg.h:71
#define ut_a(EXPR)
Abort execution if EXPR does not evaluate to nonzero.
Definition: ut0dbg.h:57
int n
Definition: xcom_base.cc:509