diff --git a/query_classifier/qc_sqlite/qc_sqlite.c b/query_classifier/qc_sqlite/qc_sqlite.c index 5e9b1eb42..a6f351c0d 100644 --- a/query_classifier/qc_sqlite/qc_sqlite.c +++ b/query_classifier/qc_sqlite/qc_sqlite.c @@ -444,25 +444,28 @@ static void parse_query_string(const char* query, size_t len) } } } - else + else if (!this_thread.info->initializing) // If we are initializing, the query will not be classified. { - if (qc_info_was_tokenized(this_thread.info->status)) + if (this_unit.log_level > QC_LOG_NOTHING) { - // This suggests a callback from the parser into this module is not made. - format = - "Statement was classified only based on keywords, " - "even though the statement was parsed: \"%.*s%s\""; + if (qc_info_was_tokenized(this_thread.info->status)) + { + // This suggests a callback from the parser into this module is not made. + format = + "Statement was classified only based on keywords, " + "even though the statement was parsed: \"%.*s%s\""; - MXS_WARNING(format, l, query, suffix); - } - else if (!qc_info_was_parsed(this_thread.info->status)) - { - // This suggests there are keywords that should be recognized but are not, - // a tentative classification cannot be (or is not) made using the keywords - // seen and/or a callback from the parser into this module is not made. - format = "Statement was parsed, but not classified: \"%.*s%s\""; + MXS_WARNING(format, l, query, suffix); + } + else if (!qc_info_was_parsed(this_thread.info->status)) + { + // This suggests there are keywords that should be recognized but are not, + // a tentative classification cannot be (or is not) made using the keywords + // seen and/or a callback from the parser into this module is not made. + format = "Statement was parsed, but not classified: \"%.*s%s\""; - MXS_ERROR(format, l, query, suffix); + MXS_WARNING(format, l, query, suffix); + } } } diff --git a/query_classifier/test/qc_sqlite_unsupported.test b/query_classifier/test/qc_sqlite_unsupported.test index ae2ffd9f1..defc70dd7 100644 --- a/query_classifier/test/qc_sqlite_unsupported.test +++ b/query_classifier/test/qc_sqlite_unsupported.test @@ -34,3 +34,11 @@ set @`TeST`=4; # (Sqlite3 error: SQL logic error or missing database, unrecognized token: "@"): "set @=4" # # sqlite3GetToken needs to be modified to accept a quoted variable name. + +SAVEPOINT sa_savepoint_1 +#warning: [qc_sqlite] Statement was neither parsed nor recognized from keywords +# (Sqlite3 error: SQL logic error or missing database, near "SNAPSHOT": syntax error): "SNAPSHOT s" + +RELEASE SAVEPOINT sa_savepoint_1 +# warning: [qc_sqlite] Statement was neither parsed nor recognized from keywords +# (Sqlite3 error: SQL logic error or missing database, near "RELEASE": syntax error): "RELEASE SNAPSHOT s" \ No newline at end of file