MXS-1512 Allow autocommit and trx state to be set for a session

When mocking you want to be able to set explicitly how a filter
session should see the current context.
This commit is contained in:
Johan Wikman 2017-11-28 13:38:44 +02:00
parent 02cf284b61
commit b225eeff2c

View File

@ -33,6 +33,8 @@ class Session : public MXS_SESSION
Session& operator = (Session&);
public:
typedef mxs_session_trx_state_t trx_state_t;
/**
* Constructor
*
@ -44,6 +46,26 @@ public:
Client& client() const;
bool is_autocommit() const
{
return session_is_autocommit(this);
}
void set_autocommit(bool autocommit)
{
session_set_autocommit(this, autocommit);
}
trx_state_t trx_state() const
{
return session_get_trx_state(this);
}
void set_trx_state(trx_state_t state)
{
session_set_trx_state(this, state);
}
private:
Client& m_client;
Dcb m_client_dcb;