diff options
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r-- | sql/sql_class.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index 1266e1777ce..9c71aba7247 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1916,6 +1916,17 @@ struct Ha_data Lifetime: one user connection. */ void *ha_ptr; + /** + A memorizer to engine specific "native" transaction object to provide + storage engine detach-re-attach facility. + The server level transaction object can dissociate from storage engine + transactions. The released "native" transaction reference + can be hold in the member until it is reconciled later. + Lifetime: Depends on caller of @c hton::replace_native_transaction_in_thd. + For instance in the case of slave server applier handling XA transaction + it is from XA START to XA PREPARE. + */ + void *ha_ptr_backup; /** 0: Life time: one statement within a transaction. If @@autocommit is on, also represents the entire transaction. @@ -1932,7 +1943,7 @@ struct Ha_data non-NULL: engine is bound to this thread, engine shutdown forbidden */ plugin_ref lock; - Ha_data() :ha_ptr(NULL) {} + Ha_data() :ha_ptr(NULL), ha_ptr_backup(NULL) {} }; /** @@ -6515,6 +6526,18 @@ inline bool add_group_to_list(THD *thd, Item *item, bool asc) return thd->lex->current_select->add_group_to_list(thd, item, asc); } +/** + @param THD thread context + @param hton pointer to handlerton + @return address of the placeholder of handlerton's specific transaction + object (data) +*/ + +inline void **thd_ha_data_backup(const THD *thd, const struct handlerton *hton) +{ + return (void **) &thd->ha_data[hton->slot].ha_ptr_backup; +} + inline Item *and_conds(THD *thd, Item *a, Item *b) { if (!b) return a; |