diff --git a/storage/rocksdb/nosql_access.cc b/storage/rocksdb/nosql_access.cc index 4abe0b7a7502..31874d307df2 100644 --- a/storage/rocksdb/nosql_access.cc +++ b/storage/rocksdb/nosql_access.cc @@ -77,6 +77,17 @@ bool inline is_supported_item_func(Item_func::Functype type) { namespace { +LEX_CSTRING select_tok{STRING_WITH_LEN("SELECT")}; +LEX_CSTRING from_tok{STRING_WITH_LEN("FROM")}; +LEX_CSTRING where_tok{STRING_WITH_LEN("WHERE")}; +LEX_CSTRING force_tok{STRING_WITH_LEN("FORCE")}; +LEX_CSTRING index_tok{STRING_WITH_LEN("INDEX")}; +LEX_CSTRING order_tok{STRING_WITH_LEN("ORDER")}; +LEX_CSTRING by_tok{STRING_WITH_LEN("BY")}; +LEX_CSTRING limit_tok{STRING_WITH_LEN("LIMIT")}; +LEX_CSTRING asc_tok{STRING_WITH_LEN("ASC")}; +LEX_CSTRING desc_tok{STRING_WITH_LEN("DESC")}; + bool check_field_name_match(Field *field, const char *field_name) { return (field->field_name && !my_strcasecmp(system_charset_info, field->field_name, field_name)); diff --git a/storage/rocksdb/rdb_nosql_digest.h b/storage/rocksdb/rdb_nosql_digest.h index 15d8c099373c..378588eaecea 100644 --- a/storage/rocksdb/rdb_nosql_digest.h +++ b/storage/rocksdb/rdb_nosql_digest.h @@ -16,25 +16,14 @@ namespace myrocks { -static LEX_CSTRING select_tok{STRING_WITH_LEN("SELECT")}; -static LEX_CSTRING from_tok{STRING_WITH_LEN("FROM")}; -static LEX_CSTRING where_tok{STRING_WITH_LEN("WHERE")}; -static LEX_CSTRING force_tok{STRING_WITH_LEN("FORCE")}; -static LEX_CSTRING index_tok{STRING_WITH_LEN("INDEX")}; -static LEX_CSTRING order_tok{STRING_WITH_LEN("ORDER")}; -static LEX_CSTRING by_tok{STRING_WITH_LEN("BY")}; -static LEX_CSTRING limit_tok{STRING_WITH_LEN("LIMIT")}; -static LEX_CSTRING asc_tok{STRING_WITH_LEN("ASC")}; -static LEX_CSTRING desc_tok{STRING_WITH_LEN("DESC")}; - -static LEX_CSTRING eq_tok{STRING_WITH_LEN("=")}; -static LEX_CSTRING lt_tok{STRING_WITH_LEN("<")}; -static LEX_CSTRING gt_tok{STRING_WITH_LEN(">")}; -static LEX_CSTRING le_tok{STRING_WITH_LEN("<=")}; -static LEX_CSTRING ge_tok{STRING_WITH_LEN(">=")}; - // This should always be synced with rocksdb::convert_where_op inline LEX_CSTRING get_op_lex_string(Item_func::Functype op) { + static LEX_CSTRING eq_tok{STRING_WITH_LEN("=")}; + static LEX_CSTRING lt_tok{STRING_WITH_LEN("<")}; + static LEX_CSTRING gt_tok{STRING_WITH_LEN(">")}; + static LEX_CSTRING le_tok{STRING_WITH_LEN("<=")}; + static LEX_CSTRING ge_tok{STRING_WITH_LEN(">=")}; + switch (op) { case Item_func::EQ_FUNC: return eq_tok;