Update autocommit mode and transaction state

The transaction state only reflects explicitly started transactions.
Thus, by looking at the autocommit mode and the transaction state a
component can figure out whether the current statement will be committed
or not.
This commit is contained in:
Johan Wikman
2016-10-25 12:36:07 +03:00
parent 041df39819
commit f961f87e5e
3 changed files with 52 additions and 22 deletions

View File

@ -142,7 +142,7 @@ session_alloc(SERVICE *service, DCB *client_dcb)
*/
session->state = SESSION_STATE_READY;
session->trx_state = SESSION_TRX_UNKNOWN;
session->trx_state = SESSION_TRX_INACTIVE;
session->autocommit = true;
/*
* Only create a router session if we are not the listening
@ -1081,8 +1081,6 @@ const char* session_trx_state_to_string(session_trx_state_t state)
{
switch (state)
{
case SESSION_TRX_UNKNOWN:
return "SESSION_TRX_UNKNOWN";
case SESSION_TRX_INACTIVE:
return "SESSION_TRX_INACTIVE";
case SESSION_TRX_ACTIVE: