to issue<52066794>:fix parser issue

This commit is contained in:
hanr881
2023-09-09 11:36:43 +00:00
committed by ob-robot
parent 7198e18f7a
commit e6dee1493e
3 changed files with 16 additions and 7 deletions

View File

@ -1030,10 +1030,7 @@ int ObSql::do_real_prepare(const ObString &sql,
LOG_WARN("session info is NULL", K(ret));
} else if (OB_FAIL(parser.parse(sql,
parse_result,
parse_mode,
false/*is_batched_multi_stmt_split_on*/,
false/*no_throw_parser_error*/,
is_from_pl))) {
parse_mode))) {
LOG_WARN("generate syntax tree failed", K(sql), K(ret));
} else if (is_mysql_mode()
&& ObSQLUtils::is_mysql_ps_not_support_stmt(parse_result)) {
@ -2212,7 +2209,7 @@ int ObSql::handle_ps_execute(const ObPsStmtId client_stmt_id,
ParseMode parse_mode = context.is_dbms_sql_ ? DBMS_SQL_MODE :
context.is_dynamic_sql_ ? DYNAMIC_SQL_MODE :
(context.session_info_->is_for_trigger_package() ? TRIGGER_MODE : STD_MODE);
if (OB_FAIL(parser.parse(sql, parse_result, parse_mode, false, false, NULL != session.get_pl_context()))) {
if (OB_FAIL(parser.parse(sql, parse_result, parse_mode))) {
LOG_WARN("failed to parse sql", K(ret), K(sql), K(stmt_type));
} else if (OB_FAIL(check_read_only_privilege(parse_result, ectx, *schema_guard, sql_traits))) {
LOG_WARN("failed to check read only privilege", K(ret));
@ -4083,7 +4080,7 @@ int ObSql::parser_and_check(const ObString &outlined_stmt,
if (OB_FAIL(parser.parse(outlined_stmt, parse_result,
pc_ctx.is_rewrite_sql_ ? UDR_SQL_MODE : STD_MODE,
pc_ctx.sql_ctx_.handle_batched_multi_stmt(),
false, NULL != session->get_pl_context()))) {
false, lib::is_mysql_mode() && NULL != session->get_pl_context()))) {
LOG_WARN("Generate syntax tree failed", K(outlined_stmt), K(ret));
} else if ((PC_PS_MODE == pc_ctx.mode_ || PC_PL_MODE == pc_ctx.mode_)
&& OB_FAIL(construct_param_store_from_parameterized_params(