#include <session_tracker.h>
|
| | Transaction_state_tracker () |
| | Constructor. More...
|
| |
| bool | enable (THD *thd) override |
| | Called in the constructor of THD. More...
|
| |
| bool | check (THD *, set_var *) override |
| | To be invoked when the tracker's system variable is checked (ON_CHECK). More...
|
| |
| bool | update (THD *thd) override |
| | Enable/disable the tracker based on @session_track_transaction_info's value. More...
|
| |
| bool | store (THD *thd, String &buf) override |
| | Store the transaction state (and, optionally, characteristics) as length-encoded string in the specified buffer. More...
|
| |
| void | mark_as_changed (THD *thd, LEX_CSTRING tracked_item_name) override |
| | Mark the tracker as changed. More...
|
| |
| void | set_read_flags (THD *thd, enum enum_tx_read_flags flags) |
| | Change transaction characteristics. More...
|
| |
| void | set_isol_level (THD *thd, enum enum_tx_isol_level level) |
| | Set isolation level pertaining to the next transaction. More...
|
| |
| void | clear_trx_state (THD *thd, uint clear) |
| | Change transaction state. More...
|
| |
| void | add_trx_state (THD *thd, uint add) |
| | Add flags pertaining to the current statement or transaction. More...
|
| |
| void | add_trx_state_from_thd (THD *thd) |
| | Add "unsafe statement" flag if applicable. More...
|
| |
| void | end_trx (THD *thd) |
| | Register the end of an (implicit or explicit) transaction. More...
|
| |
| enum_tx_state | calc_trx_state (thr_lock_type l, bool has_trx) |
| | Helper function: turn table info into table access flag. More...
|
| |
| uint | get_trx_state () const |
| | Get (possibly still incomplete) state. More...
|
| |
| | State_tracker () |
| | Constructor. More...
|
| |
| virtual | ~State_tracker ()=default |
| | Destructor. More...
|
| |
| bool | is_enabled () const |
| | Getters. More...
|
| |
| bool | is_changed () const |
| |
| virtual void | claim_memory_ownership (bool claim) |
| |
◆ enum_tx_changed
| Enumerator |
|---|
| TX_CHG_NONE | no changes from previous stmt
|
| TX_CHG_STATE | state has changed from previous stmt
|
| TX_CHG_CHISTICS | characteristics have changed from previous stmt
|
◆ Transaction_state_tracker()
| Transaction_state_tracker::Transaction_state_tracker |
( |
| ) |
|
Constructor.
Constructor for transaction state tracker.
◆ add_trx_state()
| void Transaction_state_tracker::add_trx_state |
( |
THD * |
thd, |
|
|
uint |
add |
|
) |
| |
Add flags pertaining to the current statement or transaction.
May be called repeatedly within the same execution cycle, e.g. to add access info for more tables.
- Parameters
-
| thd | The thd handle. |
| add | The flags to add |
◆ add_trx_state_from_thd()
| void Transaction_state_tracker::add_trx_state_from_thd |
( |
THD * |
thd | ) |
|
Add "unsafe statement" flag if applicable.
- Parameters
-
◆ calc_trx_state()
Helper function: turn table info into table access flag.
Accepts table lock type and engine type flag (transactional/ non-transactional), and returns the corresponding access flag out of TX_READ_TRX, TX_READ_UNSAFE, TX_WRITE_TRX, TX_WRITE_UNSAFE.
- Parameters
-
| l | The table's access/lock type |
| has_trx | Whether the table's engine is transactional |
- Returns
- The table access flag
◆ check()
| bool Transaction_state_tracker::check |
( |
THD * |
thd, |
|
|
set_var * |
var |
|
) |
| |
|
inlineoverridevirtual |
To be invoked when the tracker's system variable is checked (ON_CHECK).
Implements State_tracker.
◆ clear_trx_state()
| void Transaction_state_tracker::clear_trx_state |
( |
THD * |
thd, |
|
|
uint |
clear |
|
) |
| |
Change transaction state.
Clear flags pertaining to the current statement or transaction.
May be called repeatedly within the same execution cycle.
- Parameters
-
| thd | The thd handle. |
| clear | The flags to clear |
◆ enable()
| bool Transaction_state_tracker::enable |
( |
THD * |
thd | ) |
|
|
inlineoverridevirtual |
◆ end_trx()
| void Transaction_state_tracker::end_trx |
( |
THD * |
thd | ) |
|
Register the end of an (implicit or explicit) transaction.
- Parameters
-
◆ get_trx_state()
| uint Transaction_state_tracker::get_trx_state |
( |
| ) |
const |
|
inline |
Get (possibly still incomplete) state.
◆ mark_as_changed()
| void Transaction_state_tracker::mark_as_changed |
( |
THD * |
thd, |
|
|
LEX_CSTRING |
tracked_item_name |
|
) |
| |
|
overridevirtual |
◆ reset()
| void Transaction_state_tracker::reset |
( |
void |
| ) |
|
|
private |
Reset the m_changed flag for next statement.
◆ set_isol_level()
Set isolation level pertaining to the next transaction.
- Parameters
-
| thd | The thd handle. |
| level | The isolation level to set |
◆ set_read_flags()
Change transaction characteristics.
Set read flags (read only/read write) pertaining to the next transaction.
- Parameters
-
| thd | The thd handle. |
| flags | The flags to set |
◆ store()
| bool Transaction_state_tracker::store |
( |
THD * |
thd, |
|
|
String & |
buf |
|
) |
| |
|
overridevirtual |
Store the transaction state (and, optionally, characteristics) as length-encoded string in the specified buffer.
Once the data is stored, we reset the flags related to state-change (see reset()).
- Parameters
-
| thd | The thd handle. |
| [in,out] | buf | Buffer to store the information to. |
- Returns
- false Success true Error
Implements State_tracker.
◆ update()
| bool Transaction_state_tracker::update |
( |
THD * |
thd | ) |
|
|
overridevirtual |
Enable/disable the tracker based on @session_track_transaction_info's value.
- Parameters
-
- Returns
- true if updating the tracking level failed, false otherwise
Implements State_tracker.
◆ update_change_flags()
| void Transaction_state_tracker::update_change_flags |
( |
THD * |
thd | ) |
|
|
inlineprivate |
◆ tx_changed
| uint Transaction_state_tracker::tx_changed |
|
private |
any trackable changes caused by this statement?
◆ tx_curr_state
| uint Transaction_state_tracker::tx_curr_state |
|
private |
◆ tx_isol_level
◆ tx_read_flags
r/w or r/o set? session default?
◆ tx_reported_state
| uint Transaction_state_tracker::tx_reported_state |
|
private |
The documentation for this class was generated from the following files: