mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.3 into 10.4
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user