Track session autocommit state

This tracks only what is explicitly set. That is, if autocommit
has been set true then, even if a transaction is started, autocommit
will not be set false.

That is, a user of the session autocommit and transaction states
need to be aware of their semantics. If a transaction is active,
then the state of autocommit is irrelevant.
This commit is contained in:
Johan Wikman
2016-10-21 13:08:18 +03:00
parent 5cc436c37c
commit 693d8dcbb4
3 changed files with 45 additions and 0 deletions

View File

@ -916,6 +916,14 @@ gw_read_finish_processing(DCB *dcb, GWBUF *read_buffer, uint64_t capabilities)
{
session_set_trx_state(ses, SESSION_TRX_INACTIVE);
}
else if (type & QUERY_TYPE_ENABLE_AUTOCOMMIT)
{
session_set_autocommit(ses, true);
}
else if (type & QUERY_TYPE_DISABLE_AUTOCOMMIT)
{
session_set_autocommit(ses, false);
}
/**
* Feed each statement completely and separately