summaryrefslogtreecommitdiff
path: root/sql/sys_vars.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2019-03-18 19:18:54 +0400
committerSergey Vojtovich <svoj@mariadb.org>2019-05-03 16:40:58 +0400
commita7adc2ce1680f00635b8241202066fd5542d286f (patch)
tree78888bd51d3a47ce3393a4b3aa6728832a7167cc /sql/sys_vars.cc
parent47bd06d55ec211bc4d05d616a0833629504c7edf (diff)
downloadmariadb-git-a7adc2ce1680f00635b8241202066fd5542d286f.tar.gz
Allocate Transaction_state_tracker statically
One less new/delete per connection. Part of MDEV-14984 - regression in connect performance
Diffstat (limited to 'sql/sys_vars.cc')
-rw-r--r--sql/sys_vars.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index bea46578148..004fd4baecb 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -3743,14 +3743,12 @@ bool Sys_var_tx_read_only::session_update(THD *thd, set_var *var)
#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);
-
if (var->type == OPT_DEFAULT)
- tst->set_read_flags(thd,
+ thd->session_tracker.transaction_info.set_read_flags(thd,
thd->tx_read_only ? TX_READ_ONLY : TX_READ_WRITE);
else
- tst->set_read_flags(thd, TX_READ_INHERIT);
+ thd->session_tracker.transaction_info.set_read_flags(thd,
+ TX_READ_INHERIT);
}
#endif //EMBEDDED_LIBRARY
}
@@ -6145,8 +6143,7 @@ static bool update_session_track_tx_info(sys_var *self, THD *thd,
enum_var_type type)
{
DBUG_ENTER("update_session_track_tx_info");
- DBUG_RETURN(thd->session_tracker.get_tracker(TRANSACTION_INFO_TRACKER)->
- update(thd, NULL));
+ DBUG_RETURN(thd->session_tracker.transaction_info.update(thd, NULL));
}
static const char *session_track_transaction_info_names[]=