diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-05-05 15:03:48 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-05-05 15:06:44 +0300 |
commit | d3dcec5d657b83ca08b32f5a64b5dff01edfb13e (patch) | |
tree | 5fd801aa0daf5e74689b17ed50a086a8acd7d6e7 /sql/transaction.cc | |
parent | b132b8895e2e59df457e063451f186b53576b034 (diff) | |
parent | e8dd18a474ee6b48eb7f92e3831f9e359b0bdc6e (diff) | |
download | mariadb-git-d3dcec5d657b83ca08b32f5a64b5dff01edfb13e.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'sql/transaction.cc')
-rw-r--r-- | sql/transaction.cc | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/sql/transaction.cc b/sql/transaction.cc index bb8aaabbcb9..2887ae763df 100644 --- a/sql/transaction.cc +++ b/sql/transaction.cc @@ -35,10 +35,7 @@ void trans_track_end_trx(THD *thd) { #ifndef EMBEDDED_LIBRARY if (thd->variables.session_track_transaction_info > TX_TRACK_NONE) - { - ((Transaction_state_tracker *) - thd->session_tracker.get_tracker(TRANSACTION_INFO_TRACKER))->end_trx(thd); - } + thd->session_tracker.transaction_info.end_trx(thd); #endif //EMBEDDED_LIBRARY } @@ -52,11 +49,8 @@ void trans_reset_one_shot_chistics(THD *thd) #ifndef EMBEDDED_LIBRARY if (thd->variables.session_track_transaction_info > TX_TRACK_NONE) { - Transaction_state_tracker *tst= (Transaction_state_tracker *) - thd->session_tracker.get_tracker(TRANSACTION_INFO_TRACKER); - - tst->set_read_flags(thd, TX_READ_INHERIT); - tst->set_isol_level(thd, TX_ISOL_INHERIT); + thd->session_tracker.transaction_info.set_read_flags(thd, TX_READ_INHERIT); + thd->session_tracker.transaction_info.set_isol_level(thd, TX_ISOL_INHERIT); } #endif //EMBEDDED_LIBRARY thd->tx_isolation= (enum_tx_isolation) thd->variables.tx_isolation; @@ -101,20 +95,11 @@ static bool trans_check(THD *thd) bool trans_begin(THD *thd, uint flags) { int res= FALSE; -#ifndef EMBEDDED_LIBRARY - Transaction_state_tracker *tst= NULL; -#endif //EMBEDDED_LIBRARY DBUG_ENTER("trans_begin"); if (trans_check(thd)) DBUG_RETURN(TRUE); -#ifndef EMBEDDED_LIBRARY - if (thd->variables.session_track_transaction_info > TX_TRACK_NONE) - tst= (Transaction_state_tracker *) - thd->session_tracker.get_tracker(TRANSACTION_INFO_TRACKER); -#endif //EMBEDDED_LIBRARY - thd->locked_tables_list.unlock_locked_tables(thd); DBUG_ASSERT(!thd->locked_tables_mode); @@ -162,8 +147,8 @@ bool trans_begin(THD *thd, uint flags) { thd->tx_read_only= true; #ifndef EMBEDDED_LIBRARY - if (tst) - tst->set_read_flags(thd, TX_READ_ONLY); + if (thd->variables.session_track_transaction_info > TX_TRACK_NONE) + thd->session_tracker.transaction_info.set_read_flags(thd, TX_READ_ONLY); #endif //EMBEDDED_LIBRARY } else if (flags & MYSQL_START_TRANS_OPT_READ_WRITE) @@ -187,8 +172,8 @@ bool trans_begin(THD *thd, uint flags) just from the session's default. */ #ifndef EMBEDDED_LIBRARY - if (tst) - tst->set_read_flags(thd, TX_READ_WRITE); + if (thd->variables.session_track_transaction_info > TX_TRACK_NONE) + thd->session_tracker.transaction_info.set_read_flags(thd, TX_READ_WRITE); #endif //EMBEDDED_LIBRARY } @@ -210,16 +195,16 @@ bool trans_begin(THD *thd, uint flags) DBUG_PRINT("info", ("setting SERVER_STATUS_IN_TRANS")); #ifndef EMBEDDED_LIBRARY - if (tst) - tst->add_trx_state(thd, TX_EXPLICIT); + if (thd->variables.session_track_transaction_info > TX_TRACK_NONE) + thd->session_tracker.transaction_info.add_trx_state(thd, TX_EXPLICIT); #endif //EMBEDDED_LIBRARY /* ha_start_consistent_snapshot() relies on OPTION_BEGIN flag set. */ if (flags & MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT) { #ifndef EMBEDDED_LIBRARY - if (tst) - tst->add_trx_state(thd, TX_WITH_SNAPSHOT); + if (thd->variables.session_track_transaction_info > TX_TRACK_NONE) + thd->session_tracker.transaction_info.add_trx_state(thd, TX_WITH_SNAPSHOT); #endif //EMBEDDED_LIBRARY res= ha_start_consistent_snapshot(thd); } |