diff --git a/src/sql/parser/ob_fast_parser.cpp b/src/sql/parser/ob_fast_parser.cpp index ac05d6e5b2..f7694b0f56 100644 --- a/src/sql/parser/ob_fast_parser.cpp +++ b/src/sql/parser/ob_fast_parser.cpp @@ -1481,12 +1481,19 @@ int ObFastParserBase::process_double_quote() int ObFastParserBase::process_comment_content(bool is_mysql_comment) { int ret = OB_SUCCESS; - // if is in /*! xxx */ the token tyep should be normal + // if is in /*! xxx */ the token type should be normal cur_token_type_ = is_mysql_comment ? NORMAL_TOKEN : IGNORE_TOKEN; bool is_match = false; char ch = raw_sql_.scan(); while (!raw_sql_.is_search_end()) { - if ('*' == ch && '/' == raw_sql_.peek()) { + if (is_mysql_comment && '/' == ch && '*' == raw_sql_.peek()) { + raw_sql_.scan(); + if (OB_FAIL(process_comment_content())) { + LOG_WARN("failed to process comment content", K(ret)); + } else { + cur_token_type_ = NORMAL_TOKEN; + } + } else if ('*' == ch && '/' == raw_sql_.peek()) { // scan '\/' raw_sql_.scan(); is_match = true; diff --git a/src/sql/parser/ob_parser.cpp b/src/sql/parser/ob_parser.cpp index 02d2d15637..8e74234b6e 100644 --- a/src/sql/parser/ob_parser.cpp +++ b/src/sql/parser/ob_parser.cpp @@ -911,6 +911,7 @@ int ObParser::parse_sql(const ObString &stmt, // if is multi_values_parser opt not need retry if (lib::is_mysql_mode() && !parse_result.is_multi_values_parser_) { parse_result.enable_compatible_comment_ = false; + parse_result.mysql_compatible_comment_ = false; if (OB_FAIL(sql_parser.parse(stmt.ptr(), stmt.length(), parse_result))) { //do nothing. }