Skip to content
  • Dmitry Shulga's avatar
    7fb5c473
    This is WL#7193 (Decouple THD and st_transactions) that is a pure refactoring · 7fb5c473
    Dmitry Shulga authored
    and introduces the following changes:
      * renames the struct st_transactions to Transaction_ctx and
      moves a declaration of Transaction_ctx outside THD class;
    
      * adds the prefix m_ to all data members of classes THD_TRANS and
      Transaction_ctx;
    
      * changes the name of data member THD::transaction to THD::m_transaction,
      makes this member as private and provides access to it using the new method
      THD::get_transaction();
    
      * hides direct access to all data members of the class Transaction_ctx except
      for the data member m_savepoints;
    
      * adds the methods  init_mem_root_defaults, allocate_memory(), free_memory(),
      strmake() to get access to Transaction_ctx::m_mem_root
    
      * adds the methods add_changed_table() and
      invalidate_changed_tables_in_cache() into the class Transaction_ctx to give
      access to the data member m_changed_tables
    
      * removes the data member Transaction_ctx::m_pending_rows_event
      since it is never used within source code.
    
      * moves declarations/definitions of classes THD_TRANS,
      Ha_trx_info, Transaction_ctx from the files sql_class.h/sql_class.cc to
      the separate files transaction_info.h/transaction_info.cc.
    
      * introduces transaction_cache and functions to work with it.
      transaction_cache is used instead of xid_cache and stores a pointer to an
      instance of  class Transaction_ctx that contains full information about
      transaction in order to be able to support for detaching/attaching of XA
      transaction from THD in the future;
    
      * changes the tests setup_instruments_defaults and server_init  since
      the mutex LOCK_xid_cache was replaced by LOCK_transaction_cache and
      corresponding changes should be done in those tests results;
    
      * adds the method  Transaction_ctx::xid_state() to give access
      to the data memeber Transaction_ctx::m_xid_state;
    
      * removes the function ha_list_names() and the method
      THD_TRANS::dbug_unsafe_rollback_flags since it is used only in debug log
      output that now is considered as redundant;
    
      * hides all access to THD_TRANS::m_no_2pc and THD_TRANS::m_rw_ha_count from
      outside by corresponding methods of the class Transaction_ctx -
      set_rw_ha_count()/rw_ha_count(), no_2pc()/set_no_2pc();
    
      * moves a definition of struct THD_TRANS into the class Transaction_ctx
      to make the class THD_TRANS to be implementaion details of Transaction_ctx;
    
      * removes save/restore of transaction state from
      Ndb_local_connection::execute_query_iso() as discussed with Magnus Blåudd.
    7fb5c473
    This is WL#7193 (Decouple THD and st_transactions) that is a pure refactoring
    Dmitry Shulga authored
    and introduces the following changes:
      * renames the struct st_transactions to Transaction_ctx and
      moves a declaration of Transaction_ctx outside THD class;
    
      * adds the prefix m_ to all data members of classes THD_TRANS and
      Transaction_ctx;
    
      * changes the name of data member THD::transaction to THD::m_transaction,
      makes this member as private and provides access to it using the new method
      THD::get_transaction();
    
      * hides direct access to all data members of the class Transaction_ctx except
      for the data member m_savepoints;
    
      * adds the methods  init_mem_root_defaults, allocate_memory(), free_memory(),
      strmake() to get access to Transaction_ctx::m_mem_root
    
      * adds the methods add_changed_table() and
      invalidate_changed_tables_in_cache() into the class Transaction_ctx to give
      access to the data member m_changed_tables
    
      * removes the data member Transaction_ctx::m_pending_rows_event
      since it is never used within source code.
    
      * moves declarations/definitions of classes THD_TRANS,
      Ha_trx_info, Transaction_ctx from the files sql_class.h/sql_class.cc to
      the separate files transaction_info.h/transaction_info.cc.
    
      * introduces transaction_cache and functions to work with it.
      transaction_cache is used instead of xid_cache and stores a pointer to an
      instance of  class Transaction_ctx that contains full information about
      transaction in order to be able to support for detaching/attaching of XA
      transaction from THD in the future;
    
      * changes the tests setup_instruments_defaults and server_init  since
      the mutex LOCK_xid_cache was replaced by LOCK_transaction_cache and
      corresponding changes should be done in those tests results;
    
      * adds the method  Transaction_ctx::xid_state() to give access
      to the data memeber Transaction_ctx::m_xid_state;
    
      * removes the function ha_list_names() and the method
      THD_TRANS::dbug_unsafe_rollback_flags since it is used only in debug log
      output that now is considered as redundant;
    
      * hides all access to THD_TRANS::m_no_2pc and THD_TRANS::m_rw_ha_count from
      outside by corresponding methods of the class Transaction_ctx -
      set_rw_ha_count()/rw_ha_count(), no_2pc()/set_no_2pc();
    
      * moves a definition of struct THD_TRANS into the class Transaction_ctx
      to make the class THD_TRANS to be implementaion details of Transaction_ctx;
    
      * removes save/restore of transaction state from
      Ndb_local_connection::execute_query_iso() as discussed with Magnus Blåudd.
Loading