Merge branch '2.1' into 2.2

This commit is contained in:
Markus Mäkelä
2017-12-29 08:42:49 +02:00
13 changed files with 207 additions and 5 deletions

View File

@ -183,6 +183,8 @@ int main(int argc, char* argv[])
if (mxs_log_init(NULL, ".", MXS_LOG_TARGET_DEFAULT))
{
set_libdir(strdup("../../../query_classifier/qc_sqlite"));
// We have to setup something in order for the regexes to be compiled.
if (qc_setup("qc_sqlite", QC_SQL_MODE_DEFAULT, NULL) &&
qc_process_init(QC_INIT_BOTH) &&

View File

@ -420,6 +420,8 @@ int main(int argc, char* argv[])
if (mxs_log_init(NULL, ".", MXS_LOG_TARGET_DEFAULT))
{
set_libdir(strdup("../../../query_classifier/qc_sqlite"));
// We have to setup something in order for the regexes to be compiled.
if (qc_setup("qc_sqlite", QC_SQL_MODE_DEFAULT, NULL) &&
qc_process_init(QC_INIT_BOTH) &&

View File

@ -590,7 +590,7 @@ static pcre2_code* remove_comments_re = NULL;
static const PCRE2_SPTR remove_comments_pattern = (PCRE2_SPTR)
"(?:`[^`]*`\\K)|"
"(\\/[*](?!(M?!)).*?[*]\\/)|"
"([[:space:]](?:#.*|--[[:space:]].*(\\n|\\r\\n)))";
"((?:#.*|--[[:space:]].*)(\\n|\\r\\n|$))";
/**
* Remove SQL comments from the end of a string

View File

@ -989,6 +989,8 @@ SRWBackend handle_slave_is_target(RWSplit *inst, RWSplitSession *rses,
static void log_master_routing_failure(RWSplitSession *rses, bool found,
SRWBackend& old_master, SRWBackend& curr_master)
{
ss_dassert(!old_master || old_master->dcb()->dcb_role == DCB_ROLE_BACKEND_HANDLER);
ss_dassert(!curr_master || curr_master->dcb()->dcb_role == DCB_ROLE_BACKEND_HANDLER);
char errmsg[MAX_SERVER_ADDRESS_LEN * 2 + 100]; // Extra space for error message
if (!found)
@ -999,6 +1001,8 @@ static void log_master_routing_failure(RWSplitSession *rses, bool found,
{
/** We found a master but it's not the same connection */
ss_dassert(old_master != curr_master);
ss_dassert(old_master->dcb()->server && curr_master->dcb()->server);
if (old_master != curr_master)
{
sprintf(errmsg, "Master server changed from '%s' to '%s'",