← Back to team overview

maria-developers team mailing list archive

Re: 2564334b4c1: Backported setting of transcation.on=1 in THD::reset_for_reuse()


Hi, Michael!

> diff --git a/sql/sql_class.cc b/sql/sql_class.cc
> index 7327f270c33..8f6356b15c7 100644
> --- a/sql/sql_class.cc
> +++ b/sql/sql_class.cc
> @@ -1640,6 +1640,7 @@ void THD::reset_for_reuse()
>    abort_on_warning= 0;
>    free_connection_done= 0;
>    m_command= COM_CONNECT;
> +  transaction.on= 1;
>  #if defined(ENABLED_PROFILING)
>    profiling.reset();
>  #endif

This looks risky, to change transaction.on at some random point in time.
I understand that it's not a random point and it should be actually safe
here. But perhaps you can add an assert to document that it is safe?

Like, transaction.on should be already 1 or there should be no active

VP of MariaDB Server Engineering
and security@xxxxxxxxxxx

Follow ups