Make COMMIT/ROLLBACK a part of the transaction
The transaction tracking now flags the transaction as open even when a COMMIT/ROLLBACK is received. The next statement after the transaction is closed resets the transaction state to inactive. This means that the end of the transaction belongs in the transaction. This allows all statements that belong to a transaction to be detected with the transaction tracking functions provided by the core. With this, the routing modules should have an easier time handling transactions.
This commit is contained in:
@ -1521,12 +1521,7 @@ static int route_by_statement(MXS_SESSION* session, uint64_t capabilities, GWBUF
|
||||
else if ((type & QUERY_TYPE_COMMIT) || (type & QUERY_TYPE_ROLLBACK))
|
||||
{
|
||||
mxs_session_trx_state_t trx_state = session_get_trx_state(session);
|
||||
|
||||
/** Remove the active transaction bit and set the end
|
||||
* of transaction bit */
|
||||
trx_state &= ~SESSION_TRX_ACTIVE_BIT;
|
||||
trx_state |= SESSION_TRX_ENDING_BIT;
|
||||
|
||||
session_set_trx_state(session, trx_state);
|
||||
|
||||
if (type & QUERY_TYPE_ENABLE_AUTOCOMMIT)
|
||||
|
Reference in New Issue
Block a user