![]() |
MySQL 26.7.0
Source Code Documentation
|
Read view lists the trx ids of those transactions for which a consistent read should not see the modifications to the database. More...
#include <read0types.h>
Classes | |
| class | ids_t |
| This is similar to a std::vector but it is not a drop in replacement. More... | |
Public Member Functions | |
| ReadView () | |
| ReadView constructor. More... | |
| ~ReadView () override | |
| ReadView destructor. More... | |
| bool | changes_visible (trx_id_t id) const override |
| Check whether the changes by id are visible. More... | |
| bool | sees_all_trxs_with_id_smaller_or_equal_to (trx_id_t id) const override |
| Checks if changes made by each trx with trx->id smaller or equal to id, should be visible to this read view. More... | |
| bool | is_closed () const |
| void | print (FILE *file) const override |
| Describe the read-view. More... | |
| trx_id_t | get_lowest_needed_trx_no () const override |
| This read view does not need Undo Logs generated by transactions with trx->no strictly smaller than this value. More... | |
| bool | empty () const |
| bool | le (const ReadView *rhs) const |
Public Member Functions inherited from Read_view_interface | |
| virtual | ~Read_view_interface ()=default |
Private Member Functions | |
| void | copy_trx_ids (const trx_ids_t &trx_ids) |
| Copy the transaction ids from the source vector. More... | |
| void | prepare (trx_id_t id) |
| Opens a read view where exactly the transactions serialized before this point in time are seen in the view. More... | |
| void | copy_prepare (const ReadView &other) |
| Copy state from another view. More... | |
| void | copy_complete () |
| Complete the copy, insert the creator transaction id into the m_trx_ids too and adjust the m_up_limit_id *, if required. More... | |
| void | creator_trx_id (trx_id_t id) |
| Set the creator transaction id, existing id must be 0. More... | |
| ReadView (const ReadView &) | |
| ReadView & | operator= (const ReadView &) |
| typedef | UT_LIST_NODE_T (ReadView) node_t |
Private Attributes | |
| trx_id_t | m_low_limit_id |
| The read should not see any transaction with trx id >= this value. More... | |
| trx_id_t | m_up_limit_id |
| The read should see all trx ids which are strictly smaller (<) than this value. More... | |
| trx_id_t | m_creator_trx_id |
| If the view is open, then this is a trx->id of the transaction which has created this view, used to let this view see the changes of this transaction. More... | |
| ids_t | m_ids |
| Set of RW transactions that was active when this snapshot was taken. More... | |
| trx_id_t | m_low_limit_no |
| The view does not need to see the undo logs for transactions whose transaction number is strictly smaller (<) than this value: they can be removed in purge if not needed by other views. More... | |
| std::atomic_bool | m_closed {true} |
| False iff this view is in use by a transaction at the moment (is open). More... | |
| byte | pad1 [ut::INNODB_CACHE_LINE_SIZE] |
| List of read views in trx_sys. More... | |
| node_t | m_view_list {} |
Friends | |
| class | MVCC |
Read view lists the trx ids of those transactions for which a consistent read should not see the modifications to the database.
| ReadView::ReadView | ( | ) |
ReadView constructor.
|
override |
ReadView destructor.
|
private |
|
inlineoverridevirtual |
Check whether the changes by id are visible.
| [in] | id | transaction id to check against the view |
Implements Read_view_interface.
|
inlineprivate |
Complete the copy, insert the creator transaction id into the m_trx_ids too and adjust the m_up_limit_id *, if required.
Complete the copy, insert the creator transaction id into the m_ids too and adjust the m_up_limit_id, if required.
|
inlineprivate |
Copy state from another view.
Must call copy_complete() to finish.
| other | view to copy from |
|
inlineprivate |
Copy the transaction ids from the source vector.
|
inlineprivate |
Set the creator transaction id, existing id must be 0.
|
inline |
|
inlineoverridevirtual |
This read view does not need Undo Logs generated by transactions with trx->no strictly smaller than this value.
Implements Read_view_interface.
|
inline |
|
inline |
| rhs | view to compare with |
|
inlineprivate |
Opens a read view where exactly the transactions serialized before this point in time are seen in the view.
| id | Creator transaction id |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Checks if changes made by each trx with trx->id smaller or equal to id, should be visible to this read view.
Conceptually equivalent to: forall x<=id . changes_visible(x).
| [in] | id | max transaction id to check |
Implements Read_view_interface.
|
private |
|
friend |
|
private |
False iff this view is in use by a transaction at the moment (is open).
|
private |
If the view is open, then this is a trx->id of the transaction which has created this view, used to let this view see the changes of this transaction.
Note that a transaction might have no trx->id assigned in which case this will be 0. A transaction may also get trx->id assigned after it has already created a read view, in which case it should call set_view_creator_trx_id to update this field. It is 0 for read views cloned by clone_oldest_view. Otherwise its value doesn't matter.
|
private |
Set of RW transactions that was active when this snapshot was taken.
|
private |
The read should not see any transaction with trx id >= this value.
In other words, this is the "high water mark".
|
private |
The view does not need to see the undo logs for transactions whose transaction number is strictly smaller (<) than this value: they can be removed in purge if not needed by other views.
|
private |
The read should see all trx ids which are strictly smaller (<) than this value.
In other words, this is the low water mark".
|
private |
|
private |
List of read views in trx_sys.