Add program for profiling TrxBoundaryParser

This commit is contained in:
Johan Wikman
2017-03-14 21:36:14 +02:00
parent 9a33cf4d3e
commit 96f0321b7e
3 changed files with 143 additions and 0 deletions

View File

@ -13,6 +13,8 @@
*/
#include <maxscale/cppdefs.hh>
#include <ctype.h>
#include <maxscale/modutil.h>
#include <maxscale/query_classifier.h>
namespace maxscale
@ -89,6 +91,29 @@ public:
{
}
/**
* Return the type mask of a statement, provided the statement affects
* transaction state or autocommit mode.
*
* @param pSql SQL statament.
* @param len Length of pSql.
*
* @return The corresponding type mask or 0, if the statement does not
* affect transaction state or autocommit mode.
*/
uint32_t type_mask_of(const char* pSql, size_t len)
{
uint32_t type_mask = 0;
m_pSql = pSql;
m_len = len;
m_pI = m_pSql;
m_pEnd = m_pI + m_len;
return parse();
}
/**
* Return the type mask of a statement, provided the statement affects
* transaction state or autocommit mode.