MySQL 8.0.40
Source Code Documentation
|
The predicate lock system. More...
Go to the source code of this file.
Classes | |
struct | lock_prdt |
Typedefs | |
typedef struct lock_prdt | lock_prdt_t |
Functions | |
void | lock_prdt_lock (buf_block_t *block, lock_prdt_t *prdt, dict_index_t *index, que_thr_t *thr) |
Acquires LOCK_S | LOCK_PREDICATE on a block. More... | |
dberr_t | lock_place_prdt_page_lock (const page_id_t &page_id, dict_index_t *index, que_thr_t *thr) |
Acquire a "Page" lock on a block. More... | |
void | lock_init_prdt_from_mbr (lock_prdt_t *prdt, rtr_mbr_t *mbr, ulint mode, mem_heap_t *heap) |
Initiate a Predicate lock from a MBR. More... | |
lock_prdt_t * | lock_get_prdt_from_lock (const lock_t *lock) |
Get predicate lock's minimum bounding box. More... | |
bool | lock_prdt_has_to_wait (const trx_t *trx, ulint type_mode, lock_prdt_t *prdt, const lock_t *lock2) |
Checks if a predicate lock request for a new lock has to wait for request lock2. More... | |
void | lock_prdt_update_split (buf_block_t *block, buf_block_t *new_block, lock_prdt_t *prdt, lock_prdt_t *new_prdt) |
Update predicate lock when page splits. More... | |
void | lock_prdt_update_parent (buf_block_t *left_block, buf_block_t *right_block, lock_prdt_t *left_prdt, lock_prdt_t *right_prdt, const page_id_t &page_id) |
Adjust locks from an ancestor page of Rtree on the appropriate level . More... | |
dberr_t | lock_prdt_insert_check_and_lock (ulint flags, const rec_t *rec, buf_block_t *block, dict_index_t *index, que_thr_t *thr, mtr_t *mtr, lock_prdt_t *prdt) |
Checks if locks of other transactions prevent an immediate insert of a predicate record. More... | |
void | lock_prdt_set_prdt (lock_t *lock, const lock_prdt_t *prdt) |
Append a predicate to the lock. More... | |
void | lock_prdt_rec_move (const buf_block_t *receiver, const buf_block_t *donator) |
Moves the locks of a record to another record and resets the lock bits of the donating record. More... | |
bool | lock_other_has_prdt_page_lock (const trx_t *trx, const page_id_t &page_id) |
Check whether there are R-tree Page locks on a page by other transactions. More... | |
void | lock_prdt_page_free_from_discard (const buf_block_t *block, struct Locks_hashtable &lock_hash) |
Removes predicate lock objects set on an index page which is discarded. More... | |
The predicate lock system.
Created 9/7/2013 Jimmy Yang
typedef struct lock_prdt lock_prdt_t |
lock_prdt_t * lock_get_prdt_from_lock | ( | const lock_t * | lock | ) |
Get predicate lock's minimum bounding box.
Get predicate lock's minimum bounding box.
lock | in: the lock |
void lock_init_prdt_from_mbr | ( | lock_prdt_t * | prdt, |
rtr_mbr_t * | mbr, | ||
ulint | mode, | ||
mem_heap_t * | heap | ||
) |
Initiate a Predicate lock from a MBR.
in: heap for allocating memory
Initiate a Predicate lock from a MBR.
prdt | in/out: predicate to initialized |
mbr | in: Minimum Bounding Rectangle |
mode | in: Search mode |
heap | in: heap for allocating memory |
Check whether there are R-tree Page locks on a page by other transactions.
[in] | trx | trx to test the lock |
[in] | page_id | id of the page |
false | if there is no lock |
true | if some transaction other than trx holds a page lock |
dberr_t lock_place_prdt_page_lock | ( | const page_id_t & | page_id, |
dict_index_t * | index, | ||
que_thr_t * | thr | ||
) |
Acquire a "Page" lock on a block.
[in] | page_id | id of the page to lock |
[in] | index | secondary index |
[in] | thr | query thread |
bool lock_prdt_has_to_wait | ( | const trx_t * | trx, |
ulint | type_mode, | ||
lock_prdt_t * | prdt, | ||
const lock_t * | lock2 | ||
) |
Checks if a predicate lock request for a new lock has to wait for request lock2.
Checks if a predicate lock request for a new lock has to wait for request lock2.
trx | in: trx of new lock |
type_mode | in: precise mode of the new lock to set: LOCK_S or LOCK_X, possibly ORed to LOCK_PREDICATE or LOCK_PRDT_PAGE, LOCK_INSERT_INTENTION |
prdt | in: lock predicate to check |
lock2 | in: another record lock; NOTE that it is assumed that this has a lock bit set on the same record as in the new lock we are setting |
dberr_t lock_prdt_insert_check_and_lock | ( | ulint | flags, |
const rec_t * | rec, | ||
buf_block_t * | block, | ||
dict_index_t * | index, | ||
que_thr_t * | thr, | ||
mtr_t * | mtr, | ||
lock_prdt_t * | prdt | ||
) |
Checks if locks of other transactions prevent an immediate insert of a predicate record.
flags | in: if BTR_NO_LOCKING_FLAG bit is set, does nothing |
rec | in: record after which to insert |
block | in/out: buffer block of rec |
index | in: index |
thr | in: query thread |
mtr | in/out: mini-transaction |
prdt | in: Predicates with Minimum Bound Rectangle |
void lock_prdt_lock | ( | buf_block_t * | block, |
lock_prdt_t * | prdt, | ||
dict_index_t * | index, | ||
que_thr_t * | thr | ||
) |
Acquires LOCK_S | LOCK_PREDICATE on a block.
Always succeeds, because it never has to wait, because their only purpose is to block conflicting LOCK_X | LOCK_PREDICATE | LOCK_INSERT_INTENTION into the locked area. (In other words they are conceptually similar to gap locks in regular indexes, which also never have to wait for similar reasons)
[in] | block | Buffer block containing the rec |
[in] | prdt | Predicate for the lock |
[in] | index | Secondary index containing the block |
[in] | thr | The query thread requesting the lock |
void lock_prdt_page_free_from_discard | ( | const buf_block_t * | block, |
Locks_hashtable & | lock_hash | ||
) |
Removes predicate lock objects set on an index page which is discarded.
[in] | block | page to be discarded |
[in] | lock_hash | lock hash |
void lock_prdt_rec_move | ( | const buf_block_t * | receiver, |
const buf_block_t * | donator | ||
) |
Moves the locks of a record to another record and resets the lock bits of the donating record.
in: buffer block containing the donating record
Moves the locks of a record to another record and resets the lock bits of the donating record.
receiver | in: buffer block containing the receiving record |
donator | in: buffer block containing the donating record |
void lock_prdt_set_prdt | ( | lock_t * | lock, |
const lock_prdt_t * | prdt | ||
) |
Append a predicate to the lock.
[in] | lock | Lock |
[in] | prdt | Predicate |
void lock_prdt_update_parent | ( | buf_block_t * | left_block, |
buf_block_t * | right_block, | ||
lock_prdt_t * | left_prdt, | ||
lock_prdt_t * | right_prdt, | ||
const page_id_t & | page_id | ||
) |
Adjust locks from an ancestor page of Rtree on the appropriate level .
Check whether any predicate lock in parent needs to propagate to child page after split.
[in,out] | left_block | page to be split |
[in,out] | right_block | the new half page |
[in] | left_prdt | MBR on the old page |
[in] | right_prdt | MBR on the new page |
[in] | page_id | the parent's page id |
void lock_prdt_update_split | ( | buf_block_t * | block, |
buf_block_t * | new_block, | ||
lock_prdt_t * | prdt, | ||
lock_prdt_t * | new_prdt | ||
) |
Update predicate lock when page splits.
[in,out] | block | page to be split |
[in,out] | new_block | the new half page |
[in] | prdt | MBR on the old page |
[in] | new_prdt | MBR on the new page |