MXS-1278: Sql mode must be specified explicitly
The default sql mode must now be provided explicitly when the query classifier is setup. This is in preparation for "sql_mode" becoming a global configuration parameter of MaxScale.
This commit is contained in:
@ -1897,7 +1897,7 @@ int main(int argc, char **argv)
|
||||
cnf = config_get_global_options();
|
||||
ss_dassert(cnf);
|
||||
|
||||
if (!qc_setup(cnf->qc_name, cnf->qc_args))
|
||||
if (!qc_setup(cnf->qc_name, QC_SQL_MODE_DEFAULT, cnf->qc_args))
|
||||
{
|
||||
const char* logerr = "Failed to initialise query classifier library.";
|
||||
print_log_n_stderr(true, true, logerr, logerr, eno);
|
||||
|
||||
@ -45,7 +45,7 @@ static QUERY_CLASSIFIER* classifier;
|
||||
static qc_trx_parse_using_t qc_trx_parse_using = QC_TRX_PARSE_USING_PARSER;
|
||||
|
||||
|
||||
bool qc_setup(const char* plugin_name, const char* plugin_args)
|
||||
bool qc_setup(const char* plugin_name, qc_sql_mode_t sql_mode, const char* plugin_args)
|
||||
{
|
||||
QC_TRACE();
|
||||
ss_dassert(!classifier);
|
||||
@ -61,7 +61,7 @@ bool qc_setup(const char* plugin_name, const char* plugin_args)
|
||||
|
||||
if (classifier)
|
||||
{
|
||||
rv = classifier->qc_setup(plugin_args);
|
||||
rv = classifier->qc_setup(sql_mode, plugin_args);
|
||||
|
||||
if (rv != QC_RESULT_OK)
|
||||
{
|
||||
|
||||
@ -184,7 +184,7 @@ int main(int argc, char* argv[])
|
||||
if (mxs_log_init(NULL, ".", MXS_LOG_TARGET_DEFAULT))
|
||||
{
|
||||
// We have to setup something in order for the regexes to be compiled.
|
||||
if (qc_setup("qc_sqlite", NULL) && qc_process_init(QC_INIT_BOTH))
|
||||
if (qc_setup("qc_sqlite", QC_SQL_MODE_DEFAULT, NULL) && qc_process_init(QC_INIT_BOTH))
|
||||
{
|
||||
Tester tester(verbosity);
|
||||
|
||||
|
||||
@ -421,7 +421,7 @@ int main(int argc, char* argv[])
|
||||
if (mxs_log_init(NULL, ".", MXS_LOG_TARGET_DEFAULT))
|
||||
{
|
||||
// We have to setup something in order for the regexes to be compiled.
|
||||
if (qc_setup("qc_sqlite", NULL) && qc_process_init(QC_INIT_BOTH))
|
||||
if (qc_setup("qc_sqlite", QC_SQL_MODE_DEFAULT, NULL) && qc_process_init(QC_INIT_BOTH))
|
||||
{
|
||||
rc = EXIT_SUCCESS;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user