120 return (!(
flags & 0x01));
234 auto iter = cache.find(addr.
page);
236 if (iter == cache.end()) {
240 cache.insert(std::make_pair(addr.
page, block));
263 ut_ad(base !=
nullptr);
425 return (
payload() - index_array_size);
470 first.
load_x(page_id, page_size);
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:50
The database buffer pool high-level routines.
static buf_frame_t * buf_block_get_frame(const buf_block_t *block)
Gets a pointer to the memory frame of a block.
buf_block_t * buf_page_get(const page_id_t &id, const page_size_t &size, ulint latch, ut::Location location, mtr_t *mtr)
NOTE! The following macros should be used instead of buf_page_get_gen, to improve debugging.
Definition: buf0buf.h:425
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
page_id_t id
Page id.
Definition: buf0buf.h:1319
Page identifier.
Definition: buf0types.h:206
page_no_t page_no() const
Retrieve the page number.
Definition: buf0types.h:242
Page size descriptor.
Definition: page0size.h:49
static const page_size_t dict_table_page_size(const dict_table_t *table)
Get the table page size.
static space_id_t dict_index_get_space(const dict_index_t *index)
Gets the space id of the root of the index tree.
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:221
constexpr page_type_t FIL_PAGE_TYPE_LOB_FIRST
The first page of an uncompressed LOB.
Definition: fil0fil.h:1271
uint16_t page_type_t
Definition: fil0fil.h:1184
constexpr uint32_t FIL_PAGE_TYPE
file page type: FIL_PAGE_INDEX,..., 2 bytes.
Definition: fil0types.h:75
constexpr uint32_t FIL_PAGE_DATA
start of the data on the page
Definition: fil0types.h:110
constexpr uint32_t FIL_PAGE_DATA_END
size of the page trailer
Definition: fil0types.h:118
static byte * fut_get_ptr(space_id_t space, const page_size_t &page_size, fil_addr_t addr, rw_lock_type_t rw_latch, mtr_t *mtr, buf_block_t **ptr_block=nullptr)
Gets a pointer to a file address and latches the page.
File-based list utilities.
constexpr ulint FLST_BASE_NODE_SIZE
Definition: fut0lst.h:49
byte flst_base_node_t
Definition: fut0lst.h:45
static ulint flst_get_len(const flst_base_node_t *base)
Get the length of a list.
byte flst_node_t
Definition: fut0lst.h:46
static int flags[50]
Definition: hp_test1.cc:39
Implements the large objects (LOB) module.
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.
static void mach_write_to_6(byte *b, uint64_t id)
The following function is used to store data in 6 consecutive bytes.
static uint64_t mach_read_from_6(const byte *b)
The following function is used to fetch data from 6 consecutive bytes.
Mini-transaction logging routines.
void mlog_log_string(byte *ptr, ulint len, mtr_t *mtr)
Logs a write of a string to a file page buffered in the buffer pool.
Definition: mtr0log.cc:341
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:255
#define mtr_commit(m)
Commit a mini-transaction.
Definition: mtr0mtr.h:58
#define mtr_memo_contains(m, o, t)
Check if memo contains the given item.
Definition: mtr0mtr.h:106
#define mtr_start(m)
Start a mini-transaction.
Definition: mtr0mtr.h:49
@ MLOG_4BYTES
4 bytes ...
Definition: mtr0types.h:75
@ MLOG_1BYTE
one byte is written
Definition: mtr0types.h:69
@ MLOG_2BYTES
2 bytes ...
Definition: mtr0types.h:72
@ MTR_MEMO_PAGE_X_FIX
Definition: mtr0types.h:272
Provides the large objects (LOB) module.
Definition: lob0del.h:31
std::map< page_no_t, buf_block_t * > BlockCache
Definition: lob0index.h:36
struct result result
Definition: result.h:33
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
Data structure for an index.
Definition: dict0mem.h:1045
dict_table_t * table
back pointer to table
Definition: dict0mem.h:1059
page_size_t get_page_size() const
Get the page size of the tablespace to which this index belongs.
Definition: dict0mem.cc:894
File space address.
Definition: fil0fil.h:1139
uint32_t boffset
Byte offset within the page.
Definition: fil0fil.h:1171
page_no_t page
Page number within a space.
Definition: fil0fil.h:1168
Definition: lob0util.h:41
mtr_t * m_mtr
Definition: lob0util.h:128
dict_index_t * m_index
Definition: lob0util.h:129
page_type_t get_page_type() const
Definition: lob0util.h:94
buf_block_t * m_block
Definition: lob0util.h:127
byte * frame() const
Definition: lob0util.h:98
The first page of an uncompressed LOB.
Definition: lob0first.h:42
flst_base_node_t * index_list() const
Definition: lob0first.h:413
void set_version_0()
Set the LOB format version number to 0.
Definition: lob0first.h:106
flst_node_t * addr2ptr_x(fil_addr_t &addr) const
Load the file list node from the given location.
Definition: lob0first.h:199
byte * data_begin() const
Obtain the location where the data begins.
Definition: lob0first.h:446
buf_block_t * load_x(const page_id_t &page_id, const page_size_t &page_size, mtr_t *mtr)
Load the first page of LOB with x-latch.
Definition: lob0first.cc:360
first_page_t(mtr_t *mtr, dict_index_t *index)
Constructor.
Definition: lob0first.h:102
static const ulint OFFSET_INDEX_LIST
The offset where the list base node is located.
Definition: lob0first.h:67
undo_no_t get_last_trx_undo_no() const
Get the last transaction undo number.
Definition: lob0first.h:351
static ulint max_space_available()
Get the number of bytes used to store LOB data in the first page of uncompressed LOB.
Definition: lob0first.h:422
void set_last_trx_id(trx_id_t id)
Set the last transaction identifier.
Definition: lob0first.h:327
buf_block_t * get_block()
Get the buffer block of the LOB first page.
Definition: lob0first.h:186
std::ostream & print_index_entries(std::ostream &out) const
Definition: lob0first.cc:163
static const ulint OFFSET_LAST_TRX_ID
The latest transaction that modified this LOB.
Definition: lob0first.h:54
uint32_t incr_lob_version()
Increment the lob version by 1.
Definition: lob0first.cc:391
void set_last_trx_id_no_redo(trx_id_t id)
Set the last transaction identifier, without generating redo log records.
Definition: lob0first.h:320
void dealloc()
Free the first page.
Definition: lob0first.cc:466
bool can_be_partially_updated()
When the bit is set, the LOB is not partially updatable anymore.
Definition: lob0first.h:118
void free_all_data_pages()
Free all the data pages.
Definition: lob0first.cc:281
buf_block_t * alloc(mtr_t *alloc_mtr, bool is_bulk)
Allocate the first page for uncompressed LOB.
Definition: lob0first.cc:219
first_page_t()=default
The default constructor.
void restart_mtr(mtr_t *mtr)
Restart the given mtr.
Definition: lob0first.h:480
ulint get_data_len() const
Definition: lob0first.h:395
page_type_t get_page_type()
Definition: lob0first.h:462
std::ostream & print_index_entries_cache_s(std::ostream &out, BlockCache &cache) const
Definition: lob0first.cc:123
flst_base_node_t * free_list() const
Definition: lob0first.h:415
byte * nodes_begin() const
Get a pointer to the beginning of the index entry nodes in the first part of the page.
Definition: lob0first.h:277
bool is_empty() const
Check if the index list is empty or not.
Definition: lob0first.h:261
ulint read(ulint offset, byte *ptr, ulint want)
Read data from the first page.
Definition: lob0first.cc:419
static const ulint LOB_PAGE_TRAILER_LEN
Definition: lob0first.h:78
static const ulint OFFSET_LAST_UNDO_NO
The latest transaction undo_no that modified this LOB.
Definition: lob0first.h:57
ulint append(trx_id_t trxid, byte *&data, ulint &len)
Append data into a LOB first page.
flst_node_t * alloc_index_entry(bool bulk)
Allocate one index entry.
Definition: lob0first.cc:263
static const ulint LOB_PAGE_DATA
The offset where the contents of the first page begins.
Definition: lob0first.h:75
void free_all_index_pages()
Free all the index pages.
Definition: lob0first.cc:324
buf_block_t * load_s(page_id_t page_id, page_size_t page_size)
Load the first page of LOB with s-latch.
Definition: lob0first.h:150
flst_node_t * addr2ptr(const fil_addr_t &addr)
Load the file list node from the given location, assuming that it exists in the first page itself.
Definition: lob0first.h:207
flst_node_t * addr2ptr_s_cache(std::map< page_no_t, buf_block_t * > &cache, fil_addr_t &addr) const
Load the file list node from the given location.
Definition: lob0first.h:228
void set_trx_id(trx_id_t id)
Set the transaction identifier in the first page header.
Definition: lob0first.h:295
static const ulint OFFSET_FLAGS
One byte of flag bits.
Definition: lob0first.h:48
buf_block_t * load_x(const page_id_t &page_id, const page_size_t &page_size)
Load the first page of LOB with x-latch.
Definition: lob0first.h:180
static const uint32_t OFFSET_LOB_VERSION
LOB version.
Definition: lob0first.h:51
void destroy()
Free all the pages associated with this LOB.
Definition: lob0first.cc:474
void replace_inline(ulint offset, const byte *&ptr, ulint &want, mtr_t *mtr)
Replace data in the page inline.
Definition: lob0first.cc:35
void set_trx_id_no_redo(trx_id_t id)
Set the transaction identifier in the first page header without generating redo logs.
Definition: lob0first.h:288
void set_last_trx_undo_no(undo_no_t undo_no)
Set the last transaction undo number.
Definition: lob0first.h:335
buf_block_t * load_x(mtr_t *mtr) const
Load the first page of LOB with x-latch in the given mtr context.
Definition: lob0first.h:168
static const ulint OFFSET_INDEX_FREE_NODES
The offset where the list base node is located.
Definition: lob0first.h:71
first_page_t(buf_block_t *block, mtr_t *mtr)
Constructor.
Definition: lob0first.h:86
first_page_t(buf_block_t *block, mtr_t *mtr, dict_index_t *index)
Constructor.
Definition: lob0first.h:96
uint8_t get_flags()
Obtain the flags value.
Definition: lob0first.h:113
static page_type_t get_page_type(dict_index_t *index, const page_id_t &page_id, const page_size_t &page_size)
Definition: lob0first.h:464
constexpr static ulint node_count()
Get the number of index entries this page can hold.
Definition: lob0first.h:430
buf_block_t * replace(trx_t *trx, ulint offset, const byte *&ptr, ulint &want, mtr_t *mtr)
Replace data in the page by making a copy-on-write.
Definition: lob0first.cc:59
ulint write(trx_id_t trxid, const byte *&data, ulint &len)
Write as much as possible of the given data into the page.
Definition: lob0first.cc:434
flst_node_t * addr2ptr_s(fil_addr_t &addr)
Load the file list node from the given location.
Definition: lob0first.h:216
void set_page_type()
Definition: lob0first.h:406
static const ulint OFFSET_TRX_ID
The trx that created the data stored in this page.
Definition: lob0first.h:63
flst_node_t * addr2ptr_x(const fil_addr_t &addr, mtr_t *mtr) const
Load the file list node from the given location.
Definition: lob0first.cc:484
void set_data_len(ulint len)
Set the length of data stored in bytes.
Definition: lob0first.h:358
uint32_t get_lob_version()
Get the lob version number.
Definition: lob0first.h:310
void make_empty()
Free all the pages associated with this LOB, except the first page.
Definition: lob0first.cc:479
trx_id_t get_last_trx_id() const
Get the last transaction identifier.
Definition: lob0first.h:344
static const ulint OFFSET_DATA_LEN
Length of data stored in this page.
Definition: lob0first.h:60
first_page_t(buf_block_t *block)
Constructor.
Definition: lob0first.h:90
static ulint payload()
Calculate and return the payload.
Definition: lob0first.h:281
static const ulint OFFSET_VERSION
Version information.
Definition: lob0first.h:44
void init_lob_version()
Initialize the LOB version to 1.
Definition: lob0first.h:302
bool validate() const
Validate the first page.
Definition: lob0first.cc:207
void mark_cannot_be_partially_updated(trx_t *trx)
When the bit is set, the LOB is not partially updatable anymore.
Definition: lob0first.cc:402
static const ulint SIZE
Total length of an index node.
Definition: lob0index.h:105
Mini-transaction handle and buffer.
Definition: mtr0mtr.h:181
mtr_log_t set_log_mode(mtr_log_t mode)
Change the logging mode.
Definition: mtr0mtr.cc:470
mtr_log_t get_log_mode() const
Get the logging mode.
Definition: mtr0mtr.ic:175
Definition: trx0trx.h:680
@ RW_X_LATCH
Definition: sync0rw.h:95
@ RW_S_LATCH
Definition: sync0rw.h:94
ib_id_t undo_no_t
Undo number.
Definition: trx0types.h:141
ib_id_t trx_id_t
Transaction identifier (DB_TRX_ID, DATA_TRX_ID)
Definition: trx0types.h:137
#define UNIV_PAGE_SIZE
The universal page size of the database.
Definition: univ.i:295
unsigned long int ulint
Definition: univ.i:407
#define UT_LOCATION_HERE
Definition: ut0core.h:46
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:68