1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

MDEV-8931: (server part of) session state tracking

Transaction tracker
This commit is contained in:
Oleksandr Byelkin
2016-05-30 21:22:50 +02:00
parent c8948b0d0d
commit 0ee3e64c55
32 changed files with 1173 additions and 270 deletions

View File

@@ -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