Remove support for TrxBoundaryMatcher

For the general case, regex matching simply will not do. The
regex becomes so hairy so it turns write-only, i.e. unmaintainable.
Regex matching is also slower than a handwritten custom parser.
This commit is contained in:
Johan Wikman
2017-03-15 10:34:56 +02:00
parent c235e181ce
commit 5e39268e37
6 changed files with 11 additions and 483 deletions

View File

@ -20,7 +20,6 @@ MXS_BEGIN_DECLS
typedef enum qc_trx_parse_using
{
QC_TRX_PARSE_USING_QC, /**< Use the query classifier. */
QC_TRX_PARSE_USING_REGEX, /**< Use regexp mathing. */
QC_TRX_PARSE_USING_PARSER, /**< Use custom parser. */
} qc_trx_parse_using_t;

View File

@ -1,87 +0,0 @@
#pragma once
/*
* Copyright (c) 2016 MariaDB Corporation Ab
*
* Use of this software is governed by the Business Source License included
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
*
* Change Date: 2019-07-01
*
* On the date above, in accordance with the Business Source License, use
* of this software will be governed by version 2 or later of the General
* Public License.
*/
#include <maxscale/cppdefs.hh>
#include <maxscale/pcre2.h>
#include <maxscale/query_classifier.h>
namespace maxscale
{
/**
* @class TrxBoundaryMatcher
*
* @ TrxBoundaryMatcher is a class capable of, using regexes, to recognize
* and return the correct type mask of statements affecting the transaction
* state and* autocommit mode.
*/
class TrxBoundaryMatcher
{
public:
/**
* To be called once at process startup. After a successful call,
* @type_mask_of() can be used in the calling thread.
*
* @return True, if the initialization succeeded, false otherwise.
*/
static bool process_init();
/**
* To be called once at process shut down.
*/
static void process_end();
/**
* To be called once in each thread, other that the one where @process_init()
* was called. After a successful call, @type_mask_of() can be used in the
* calling thread.
*
* @return True, if the initialization succeeded, false otherwise.
*/
static bool thread_init();
/**
* To be called once at thread shut down.
*/
static void thread_end();
/**
* Return the type mask of a statement, provided the statement affects
* transaction state or autocommit mode.
*
* @param pSql Sql statement.
* @param len Length of @c pSql.
*
* @return The corresponding type mask or 0, if the statement does not
* affect transaction state or autocommit mode.
*/
static uint32_t type_mask_of(const char* pSql, size_t len);
/**
* Return the type mask of a statement, provided the statement affects
* transaction state or autocommit mode.
*
* @param pBuf A COM_QUERY
*
* @return The corresponding type mask or 0, if the statement does not
* affect transaction state or autocommit mode.
*/
static uint32_t type_mask_of(GWBUF* pBuf);
private:
TrxBoundaryMatcher(const TrxBoundaryMatcher&);
TrxBoundaryMatcher& operator = (const TrxBoundaryMatcher&);
};
}