Partially revert 4ba011266843857bbd3201e5b925a47e88e1808f

Add back leading operator enforcement.
This commit is contained in:
Markus Mäkelä
2018-09-20 15:26:51 +03:00
parent d8d0b1a29c
commit 71ffef5708
95 changed files with 1395 additions and 1392 deletions

View File

@ -2479,9 +2479,9 @@ static QC_FUNCTION_INFO* get_function_info(parsing_info_t* info, const char* nam
if (info->function_infos_len == info->function_infos_capacity)
{
size_t capacity = info->function_infos_capacity ? 2 * info->function_infos_capacity : 8;
QC_FUNCTION_INFO* function_infos
= (QC_FUNCTION_INFO*)realloc(info->function_infos,
capacity * sizeof(QC_FUNCTION_INFO));
QC_FUNCTION_INFO* function_infos =
(QC_FUNCTION_INFO*)realloc(info->function_infos,
capacity * sizeof(QC_FUNCTION_INFO));
assert(function_infos);
info->function_infos = function_infos;
@ -2977,8 +2977,8 @@ static void update_field_infos(parsing_info_t* pi,
case Item_subselect::EXISTS_SUBS:
{
Item_exists_subselect* exists_subselect_item
= static_cast<Item_exists_subselect*>(item);
Item_exists_subselect* exists_subselect_item =
static_cast<Item_exists_subselect*>(item);
st_select_lex* ssl = exists_subselect_item->get_select_lex();
if (ssl)

View File

@ -441,8 +441,8 @@ static const char* BUILTIN_10_2_3_FUNCTIONS[] =
"row_number",
};
const size_t N_BUILTIN_10_2_3_FUNCTIONS
= sizeof(BUILTIN_10_2_3_FUNCTIONS) / sizeof(BUILTIN_10_2_3_FUNCTIONS[0]);
const size_t N_BUILTIN_10_2_3_FUNCTIONS =
sizeof(BUILTIN_10_2_3_FUNCTIONS) / sizeof(BUILTIN_10_2_3_FUNCTIONS[0]);
static const char* ORACLE_FUNCTIONS[] =
{

View File

@ -3393,17 +3393,17 @@ static void parse_query_string(const char* query, int len, bool suppress_logging
{
if (qc_info_was_tokenized(this_thread.pInfo->m_status))
{
format
= "Statement was classified only based on keywords "
"(Sqlite3 error: %s, %s): \"%.*s%s\"";
format =
"Statement was classified only based on keywords "
"(Sqlite3 error: %s, %s): \"%.*s%s\"";
}
else
{
if (qc_info_was_parsed(this_thread.pInfo->m_status))
{
format
= "Statement was only partially parsed "
"(Sqlite3 error: %s, %s): \"%.*s%s\"";
format =
"Statement was only partially parsed "
"(Sqlite3 error: %s, %s): \"%.*s%s\"";
// The status was set to QC_QUERY_PARSED, but sqlite3 returned an
// error. Most likely, query contains some excess unrecognized stuff.
@ -3411,9 +3411,9 @@ static void parse_query_string(const char* query, int len, bool suppress_logging
}
else
{
format
= "Statement was neither parsed nor recognized from keywords "
"(Sqlite3 error: %s, %s): \"%.*s%s\"";
format =
"Statement was neither parsed nor recognized from keywords "
"(Sqlite3 error: %s, %s): \"%.*s%s\"";
}
}
@ -3461,9 +3461,9 @@ static void parse_query_string(const char* query, int len, bool suppress_logging
if (qc_info_was_tokenized(this_thread.pInfo->m_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\"";
format =
"Statement was classified only based on keywords, "
"even though the statement was parsed: \"%.*s%s\"";
MXS_WARNING(format, l, query, suffix);
}
@ -3503,8 +3503,8 @@ static bool parse_query(GWBUF* query, uint32_t collect)
{
bool suppress_logging = false;
QcSqliteInfo* pInfo
= (QcSqliteInfo*) gwbuf_get_buffer_object_data(query, GWBUF_PARSING_INFO);
QcSqliteInfo* pInfo =
(QcSqliteInfo*) gwbuf_get_buffer_object_data(query, GWBUF_PARSING_INFO);
if (pInfo)
{

View File

@ -47,24 +47,24 @@ using std::stringstream;
namespace
{
char USAGE[]
= "usage: compare [-r count] [-d] [-1 classfier1] [-2 classifier2] "
"[-A args] [-B args] [-C args] [-m [default|oracle]] [-v [0..2]] [-s statement]|[file]]\n\n"
"-r redo the test the specified number of times; 0 means forever, default is 1\n"
"-d don't stop after first failed query\n"
"-1 the first classifier, default 'qc_mysqlembedded'\n"
"-2 the second classifier, default 'qc_sqlite'\n"
"-A arguments for the first classifier\n"
"-B arguments for the second classifier\n"
"-C arguments for both classifiers\n"
"-m initial sql mode, 'default' or 'oracle', default is 'default'\n"
"-s compare single statement\n"
"-S strict, also require that the parse result is identical\n"
"-R strict reporting, report if parse result is different\n"
"-v 0, only return code\n"
" 1, query and result for failed cases\n"
" 2, all queries, and result for failed cases\n"
" 3, all queries and all results\n";
char USAGE[] =
"usage: compare [-r count] [-d] [-1 classfier1] [-2 classifier2] "
"[-A args] [-B args] [-C args] [-m [default|oracle]] [-v [0..2]] [-s statement]|[file]]\n\n"
"-r redo the test the specified number of times; 0 means forever, default is 1\n"
"-d don't stop after first failed query\n"
"-1 the first classifier, default 'qc_mysqlembedded'\n"
"-2 the second classifier, default 'qc_sqlite'\n"
"-A arguments for the first classifier\n"
"-B arguments for the second classifier\n"
"-C arguments for both classifiers\n"
"-m initial sql mode, 'default' or 'oracle', default is 'default'\n"
"-s compare single statement\n"
"-S strict, also require that the parse result is identical\n"
"-R strict reporting, report if parse result is different\n"
"-v 0, only return code\n"
" 1, query and result for failed cases\n"
" 2, all queries, and result for failed cases\n"
" 3, all queries and all results\n";
enum verbosity_t