diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2016-05-30 21:22:50 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2016-08-31 17:17:46 +0200 |
commit | 0ee3e64c55664332e8e92eda55b43692159fe4fe (patch) | |
tree | b12a876260d383a9ded16593bda2edcc668cbf7c /sql/sql_parse.cc | |
parent | c8948b0d0db4c182a744bc8bdbde7cbccff3d57d (diff) | |
download | mariadb-git-0ee3e64c55664332e8e92eda55b43692159fe4fe.tar.gz |
MDEV-8931: (server part of) session state tracking
Transaction tracker
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 7cb97d156cb..8dc34c2dfe2 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3855,9 +3855,9 @@ mysql_execute_command(THD *thd) /* in case of create temp tables if @@session_track_state_change is ON then send session state notification in OK packet */ if(create_info.options & HA_LEX_CREATE_TMP_TABLE) - thd->session_tracker.mark_as_changed(thd, - SESSION_STATE_CHANGE_TRACKER, - NULL); + { + SESSION_TRACKER_CHANGED(thd, SESSION_STATE_CHANGE_TRACKER, NULL); + } my_ok(thd); } } @@ -4619,8 +4619,7 @@ end_with_restore_list: send the boolean tracker in the OK packet */ if(!res && (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)) { - thd->session_tracker.mark_as_changed(thd, SESSION_STATE_CHANGE_TRACKER, - NULL); + SESSION_TRACKER_CHANGED(thd, SESSION_STATE_CHANGE_TRACKER, NULL); } break; } @@ -5433,8 +5432,7 @@ end_with_restore_list: else { /* Reset the isolation level and access mode if no chaining transaction.*/ - thd->tx_isolation= (enum_tx_isolation) thd->variables.tx_isolation; - thd->tx_read_only= thd->variables.tx_read_only; + trans_reset_one_shot_chistics(thd); } /* Disconnect the current client connection. */ if (tx_release) @@ -5481,8 +5479,7 @@ end_with_restore_list: else { /* Reset the isolation level and access mode if no chaining transaction.*/ - thd->tx_isolation= (enum_tx_isolation) thd->variables.tx_isolation; - thd->tx_read_only= thd->variables.tx_read_only; + trans_reset_one_shot_chistics(thd); } /* Disconnect the current client connection. */ if (tx_release) @@ -5967,8 +5964,7 @@ end_with_restore_list: We've just done a commit, reset transaction isolation level and access mode to the session default. */ - thd->tx_isolation= (enum_tx_isolation) thd->variables.tx_isolation; - thd->tx_read_only= thd->variables.tx_read_only; + trans_reset_one_shot_chistics(thd); my_ok(thd); break; } @@ -5986,8 +5982,7 @@ end_with_restore_list: We've just done a rollback, reset transaction isolation level and access mode to the session default. */ - thd->tx_isolation= (enum_tx_isolation) thd->variables.tx_isolation; - thd->tx_read_only= thd->variables.tx_read_only; + trans_reset_one_shot_chistics(thd); my_ok(thd); break; } @@ -6205,6 +6200,9 @@ finish: { thd->mdl_context.release_statement_locks(); } + + TRANSACT_TRACKER(add_trx_state_from_thd(thd)); + WSREP_TO_ISOLATION_END; #ifdef WITH_WSREP |