![]()  | 
  
    MySQL 8.4.7
    
   Source Code Documentation 
   | 
 
Wrapper of mysql.innodb_ddl_log table. More...
#include <log0ddl.h>
Public Member Functions | |
| DDL_Log_Table () | |
| Constructor.  More... | |
| DDL_Log_Table (trx_t *trx) | |
| Constructor and it initializes transaction and query thread.  More... | |
| ~DDL_Log_Table () | |
| Destructor.  More... | |
| dberr_t | insert (const DDL_Record &record) | 
| Insert the DDL log record into the innodb_ddl_log table.  More... | |
| dberr_t | search (ulint thread_id, DDL_Records &records) | 
| Search for all records of specified thread_id.  More... | |
| dberr_t | search_all (DDL_Records &records) | 
| Do a reverse scan on the table to fetch all the record.  More... | |
| dberr_t | remove (ulint id) | 
| Delete the innodb_ddl_log record of specified ID.  More... | |
| dberr_t | remove (const DDL_Records &records) | 
| Delete specified DDL_Records from innodb_ddl_log.  More... | |
Private Member Functions | |
| void | start_query_thread () | 
| Set the query thread using graph.  More... | |
| void | stop_query_thread () | 
| Stop the query thread.  More... | |
| void | create_tuple (const DDL_Record &record) | 
| Create tuple for the innodb_ddl_log table.  More... | |
| void | create_tuple (ulint id, const dict_index_t *index) | 
| Create tuple for the given index.  More... | |
| void | convert_to_ddl_record (bool is_clustered, rec_t *rec, const ulint *offsets, DDL_Record &record) | 
| Convert the innodb_ddl_log index record to DDL_Record.  More... | |
| ulint | parse_id (const dict_index_t *index, rec_t *rec, const ulint *offsets) | 
| Parse the index record and get 'ID'.  More... | |
| void | set_field (const byte *data, ulint offset, ulint len, DDL_Record &record) | 
| Set the given field of the innodb_ddl_log record from given data.  More... | |
| ulint | fetch_value (const byte *data, ulint offset) | 
| Fetch the value from given offset.  More... | |
| dberr_t | search_by_id (ulint id, dict_index_t *index, DDL_Records &records) | 
| Search specified index by specified ID.  More... | |
Private Attributes | |
| dict_table_t * | m_table | 
| innodb_ddl_log table.  More... | |
| dtuple_t * | m_tuple | 
| Tuple used for insert, search, delete operation.  More... | |
| trx_t * | m_trx | 
| Transaction used for insert, delete operation.  More... | |
| que_thr_t * | m_thr | 
| Dummy query thread.  More... | |
| mem_heap_t * | m_heap | 
| Heap to store the m_tuple, m_thr and all operation on mysql.innodb_ddl_log table.  More... | |
Static Private Attributes | |
| static constexpr unsigned | s_id_col_no = 0 | 
| Column number of mysql.innodb_ddl_log.id.  More... | |
| static constexpr unsigned | s_id_col_len = 8 | 
| Column length of mysql.innodb_ddl_log.id.  More... | |
| static constexpr unsigned | s_thread_id_col_no = 1 | 
| Column number of mysql.innodb_ddl_log.thread_id.  More... | |
| static constexpr unsigned | s_thread_id_col_len = 8 | 
| Column length of mysql.innodb_ddl_log.thread_id.  More... | |
| static constexpr unsigned | s_type_col_no = 2 | 
| Column number of mysql.innodb_ddl_log.type.  More... | |
| static constexpr unsigned | s_type_col_len = 4 | 
| Column length of mysql.innodb_ddl_log.type.  More... | |
| static constexpr unsigned | s_space_id_col_no = 3 | 
| Column number of mysql.innodb_ddl_log.space_id.  More... | |
| static constexpr unsigned | s_space_id_col_len = 4 | 
| Column length of mysql.innodb_ddl_log.space_id.  More... | |
| static constexpr unsigned | s_page_no_col_no = 4 | 
| Column number of mysql.innodb_ddl_log.page_no.  More... | |
| static constexpr unsigned | s_page_no_col_len = 4 | 
| Column length of mysql.innodb_ddl_log.page_no.  More... | |
| static constexpr unsigned | s_index_id_col_no = 5 | 
| Column number of mysql.innodb_ddl_log.index_id.  More... | |
| static constexpr unsigned | s_index_id_col_len = 8 | 
| Column length of mysql.innodb_ddl_log.index_id.  More... | |
| static constexpr unsigned | s_table_id_col_no = 6 | 
| Column number of mysql.innodb_ddl_log.table_id.  More... | |
| static constexpr unsigned | s_table_id_col_len = 8 | 
| Column length of mysql.innodb_ddl_log.table_id.  More... | |
| static constexpr unsigned | s_old_file_path_col_no = 7 | 
| Column number of mysql.innodb_ddl_log.old_file_path.  More... | |
| static constexpr unsigned | s_new_file_path_col_no = 8 | 
| Column number of mysql.innodb_ddl_log.new_file_path.  More... | |
Wrapper of mysql.innodb_ddl_log table.
Accessing to this table doesn't require row lock because thread could only access/modify its own ddl records.
| DDL_Log_Table::DDL_Log_Table | ( | ) | 
Constructor.
      
  | 
  explicit | 
Constructor and it initializes transaction and query thread.
Once trx is passed in, make sure destructor is called before the trx commits.
| [in,out] | trx | Transaction | 
| DDL_Log_Table::~DDL_Log_Table | ( | ) | 
Destructor.
      
  | 
  private | 
Convert the innodb_ddl_log index record to DDL_Record.
| [in] | is_clustered | true if this is clustered index record, otherwise the secondary index record | 
| [in] | rec | index record | 
| [in] | offsets | index record offset | 
| [in,out] | record | to store the innodb_ddl_log record. | 
      
  | 
  private | 
Create tuple for the innodb_ddl_log table.
It is used for insert operation.
| [in] | record | DDL log record. | 
      
  | 
  private | 
Create tuple for the given index.
Used for search by id (and following delete)
| [in] | id | Thread id/ id of the record | 
| [in] | index | Clustered index or secondary index. | 
Fetch the value from given offset.
| [in] | data | value to be retrieved from data | 
| [in] | offset | offset of the column | 
| dberr_t DDL_Log_Table::insert | ( | const DDL_Record & | record | ) | 
Insert the DDL log record into the innodb_ddl_log table.
This is thread safe.
| [in] | record | Record to be inserted. | 
      
  | 
  private | 
Parse the index record and get 'ID'.
| [in] | index | index where the record resides | 
| [in] | rec | index rec | 
| [in] | offsets | offsets of the index. | 
| dberr_t DDL_Log_Table::remove | ( | const DDL_Records & | records | ) | 
Delete specified DDL_Records from innodb_ddl_log.
This is thread safe. Different threads have their own ddl records to delete. And this could be called during recovery.
| [in] | records | DDL_Record(s) to be deleted | 
Delete the innodb_ddl_log record of specified ID.
This is thread safe. One thread will only remove its ddl record.
| [in] | id | ID of the DDL_Record | 
| dberr_t DDL_Log_Table::search | ( | ulint | thread_id, | 
| DDL_Records & | records | ||
| ) | 
Search for all records of specified thread_id.
The records are kept in reverse order. This is thread safe. Because different threads have different thread ids, there should not be any conflict with update.
| [in] | thread_id | thread id to search | 
| [out] | records | DDL_Records of the specified thread id | 
| dberr_t DDL_Log_Table::search_all | ( | DDL_Records & | records | ) | 
Do a reverse scan on the table to fetch all the record.
This is only called during recovery
| [out] | records | DDL_Records of the whole table | 
Scan the index in decreasing order.
      
  | 
  private | 
Search specified index by specified ID.
| [in] | id | ID to search | 
| [in] | index | index to search | 
| [in,out] | records | DDL_Record(s) got by the search | 
      
  | 
  private | 
Set the given field of the innodb_ddl_log record from given data.
| [in] | data | data to be set | 
| [in] | offset | column of the ddl record | 
| [in] | len | length of the data | 
| [in,out] | record | DDL_Record to set | 
      
  | 
  private | 
Set the query thread using graph.
      
  | 
  private | 
Stop the query thread.
      
  | 
  private | 
Heap to store the m_tuple, m_thr and all operation on mysql.innodb_ddl_log table.
      
  | 
  private | 
innodb_ddl_log table.
      
  | 
  private | 
Dummy query thread.
      
  | 
  private | 
Transaction used for insert, delete operation.
      
  | 
  private | 
Tuple used for insert, search, delete operation.
      
  | 
  staticconstexprprivate | 
Column length of mysql.innodb_ddl_log.id.
      
  | 
  staticconstexprprivate | 
Column number of mysql.innodb_ddl_log.id.
      
  | 
  staticconstexprprivate | 
Column length of mysql.innodb_ddl_log.index_id.
      
  | 
  staticconstexprprivate | 
Column number of mysql.innodb_ddl_log.index_id.
      
  | 
  staticconstexprprivate | 
Column number of mysql.innodb_ddl_log.new_file_path.
      
  | 
  staticconstexprprivate | 
Column number of mysql.innodb_ddl_log.old_file_path.
      
  | 
  staticconstexprprivate | 
Column length of mysql.innodb_ddl_log.page_no.
      
  | 
  staticconstexprprivate | 
Column number of mysql.innodb_ddl_log.page_no.
      
  | 
  staticconstexprprivate | 
Column length of mysql.innodb_ddl_log.space_id.
      
  | 
  staticconstexprprivate | 
Column number of mysql.innodb_ddl_log.space_id.
      
  | 
  staticconstexprprivate | 
Column length of mysql.innodb_ddl_log.table_id.
      
  | 
  staticconstexprprivate | 
Column number of mysql.innodb_ddl_log.table_id.
      
  | 
  staticconstexprprivate | 
Column length of mysql.innodb_ddl_log.thread_id.
      
  | 
  staticconstexprprivate | 
Column number of mysql.innodb_ddl_log.thread_id.
      
  | 
  staticconstexprprivate | 
Column length of mysql.innodb_ddl_log.type.
      
  | 
  staticconstexprprivate | 
Column number of mysql.innodb_ddl_log.type.