From ddca87aa3d338a136f3a212e4305e73ef76d10cc Mon Sep 17 00:00:00 2001 From: obdev Date: Wed, 10 May 2023 13:17:17 +0000 Subject: [PATCH] Fix const number of fast parse and normal parse is different --- src/sql/parser/ob_fast_parser.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sql/parser/ob_fast_parser.cpp b/src/sql/parser/ob_fast_parser.cpp index f7694b0f56..118c5d3bf7 100644 --- a/src/sql/parser/ob_fast_parser.cpp +++ b/src/sql/parser/ob_fast_parser.cpp @@ -1018,10 +1018,18 @@ int ObFastParserBase::process_hex_number(bool is_quote) } } else { // 0X([0-9A-F])+ - cur_token_type_ = PARAM_TOKEN; while (is_hex(next_ch)) { next_ch = raw_sql_.scan(); } + int64_t next_idf_pos = is_first_identifier_flags(raw_sql_.cur_pos_); + if (-1 != next_idf_pos) { + // it is possible that the next token is a string and needs to fall back to + // the position of quote + raw_sql_.cur_pos_ = pos; + cur_token_type_ = NORMAL_TOKEN; + } else { + cur_token_type_ = PARAM_TOKEN; + } } if (OB_SUCC(ret) && PARAM_TOKEN == cur_token_type_) { char *buf = nullptr;