MySQL 8.4.2
Source Code Documentation
Open_table_context Class Reference

A context of open_tables() function, used to recover from a failed open_table() or open_routine() attempt. More...

#include <sql_base.h>

Public Types

enum  enum_open_table_action {
  OT_NO_ACTION = 0 , OT_BACKOFF_AND_RETRY , OT_REOPEN_TABLES , OT_DISCOVER ,
  OT_REPAIR , OT_FIX_ROW_TYPE
}
 

Public Member Functions

 Open_table_context (THD *thd, uint flags)
 Open_table_context. More...
 
bool recover_from_failed_open ()
 Recover from failed attempt of open table by performing requested action. More...
 
bool request_backoff_action (enum_open_table_action action_arg, Table_ref *table)
 Check if we can back-off and set back off action if we can. More...
 
bool can_recover_from_failed_open () const
 
const MDL_savepointstart_of_statement_svp () const
 When doing a back-off, we close all tables acquired by this statement. More...
 
ulong get_timeout () const
 
uint get_flags () const
 
void set_has_protection_against_grl ()
 Set flag indicating that we have already acquired metadata lock protecting this statement against GRL while opening tables. More...
 
bool has_protection_against_grl () const
 
bool can_back_off () const
 

Private Attributes

THDm_thd
 
Table_refm_failed_table
 For OT_DISCOVER, OT_REPAIR and OT_FIX_ROW_TYPE actions, the table list element for the table which definition should be re-discovered/updated or which should be repaired. More...
 
MDL_savepoint m_start_of_statement_svp
 
ulong m_timeout
 Lock timeout in seconds. More...
 
uint m_flags
 
enum enum_open_table_action m_action
 Back off action. More...
 
bool m_has_locks
 Whether we had any locks when this context was created. More...
 
bool m_has_protection_against_grl
 Indicates that in the process of opening tables we have acquired protection against global read lock. More...
 

Detailed Description

A context of open_tables() function, used to recover from a failed open_table() or open_routine() attempt.

Member Enumeration Documentation

◆ enum_open_table_action

Enumerator
OT_NO_ACTION 
OT_BACKOFF_AND_RETRY 
OT_REOPEN_TABLES 
OT_DISCOVER 
OT_REPAIR 
OT_FIX_ROW_TYPE 

Member Function Documentation

◆ can_back_off()

bool Open_table_context::can_back_off ( ) const
inline

◆ can_recover_from_failed_open()

bool Open_table_context::can_recover_from_failed_open ( ) const
inline

◆ get_flags()

uint Open_table_context::get_flags ( ) const
inline

◆ get_timeout()

ulong Open_table_context::get_timeout ( ) const
inline

◆ has_protection_against_grl()

bool Open_table_context::has_protection_against_grl ( ) const
inline

◆ set_has_protection_against_grl()

void Open_table_context::set_has_protection_against_grl ( )
inline

Set flag indicating that we have already acquired metadata lock protecting this statement against GRL while opening tables.

◆ start_of_statement_svp()

const MDL_savepoint & Open_table_context::start_of_statement_svp ( ) const
inline

When doing a back-off, we close all tables acquired by this statement.

Return an MDL savepoint taken at the beginning of the statement, so that we can rollback to it before waiting on locks.

Member Data Documentation

◆ m_action

enum enum_open_table_action Open_table_context::m_action
private

Back off action.

◆ m_failed_table

Table_ref* Open_table_context::m_failed_table
private

For OT_DISCOVER, OT_REPAIR and OT_FIX_ROW_TYPE actions, the table list element for the table which definition should be re-discovered/updated or which should be repaired.

◆ m_flags

uint Open_table_context::m_flags
private

◆ m_has_locks

bool Open_table_context::m_has_locks
private

Whether we had any locks when this context was created.

If we did, they are from the previous statement of a transaction, and we can't safely do back-off (and release them).

◆ m_has_protection_against_grl

bool Open_table_context::m_has_protection_against_grl
private

Indicates that in the process of opening tables we have acquired protection against global read lock.

◆ m_start_of_statement_svp

MDL_savepoint Open_table_context::m_start_of_statement_svp
private

◆ m_thd

THD* Open_table_context::m_thd
private

◆ m_timeout

ulong Open_table_context::m_timeout
private

Lock timeout in seconds.

Initialized to LONG_TIMEOUT when opening system tables or to the "lock_wait_timeout" system variable for regular tables.


The documentation for this class was generated from the following files: