MXS-938: Recognize transaction start
Now more information about a transaction start is provided. When a transaction start statement is parsed, the type of the statement with be QUERY_TYPE_BEGIN_TRX anded with QUERY_TYPE_READ or QUERY_TYPE_WRITE if the transaction was explicitly started as READ ONLY or READ WRITE. Now also BEGIN WORK and [COMMIT|ROLLBACK] WORK are recognized. "AND CHAIN" will still need to be recognized.
This commit is contained in:
@ -630,6 +630,14 @@ static uint32_t resolve_query_type(THD* thd)
|
||||
|
||||
case SQLCOM_BEGIN:
|
||||
type |= QUERY_TYPE_BEGIN_TRX;
|
||||
if (lex->start_transaction_opt & MYSQL_START_TRANS_OPT_READ_WRITE)
|
||||
{
|
||||
type |= QUERY_TYPE_WRITE;
|
||||
}
|
||||
else if (lex->start_transaction_opt & MYSQL_START_TRANS_OPT_READ_ONLY)
|
||||
{
|
||||
type |= QUERY_TYPE_READ;
|
||||
}
|
||||
goto return_qtype;
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user