[to #49328715] fix a -4016 problem of trigger parser
This commit is contained in:
parent
4ead928e53
commit
d89b3ef9ef
@ -359,7 +359,14 @@ outer_stmt:
|
||||
| package_body_block { $$ = $1; }
|
||||
| create_trigger_stmt { $$ = $1; }
|
||||
| drop_trigger_stmt { $$ = $1; }
|
||||
| plsql_trigger_source { $$ = $1; }
|
||||
| plsql_trigger_source
|
||||
{
|
||||
if (!parse_ctx->is_inner_parse_) {
|
||||
obpl_mysql_yyerror(&@1, parse_ctx, "Syntax Error\n");
|
||||
YYERROR;
|
||||
}
|
||||
$$ = $1;
|
||||
}
|
||||
;
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -361,7 +361,8 @@ int ObTriggerInfo::gen_package_source(const uint64_t tenant_id,
|
||||
CK (OB_NOT_NULL(trigger_info));
|
||||
if (OB_SUCC(ret)) {
|
||||
ObParser parser(alloc, trigger_info->get_sql_mode());
|
||||
OZ (parser.parse(trigger_info->get_trigger_body(), parse_result, TRIGGER_MODE),
|
||||
OZ (parser.parse(trigger_info->get_trigger_body(), parse_result,
|
||||
TRIGGER_MODE, false, false, true),
|
||||
trigger_info->get_trigger_body());
|
||||
// stmt list node.
|
||||
OV (OB_NOT_NULL(stmt_list_node = parse_result.result_tree_));
|
||||
@ -1042,7 +1043,9 @@ int ObTriggerInfo::replace_table_name_in_body(ObTriggerInfo &trigger_info,
|
||||
const ParseNode *base_schema_node = NULL;
|
||||
const ParseNode *base_object_node = NULL;
|
||||
|
||||
OZ (parser.parse(trigger_info.get_trigger_body(), parse_result, TRIGGER_MODE), trigger_info.get_trigger_body());
|
||||
OZ (parser.parse(trigger_info.get_trigger_body(), parse_result, TRIGGER_MODE,
|
||||
false, false, true),
|
||||
trigger_info.get_trigger_body());
|
||||
// stmt list node
|
||||
OV (OB_NOT_NULL(stmt_list_node = parse_result.result_tree_));
|
||||
OV (stmt_list_node->type_ == T_STMT_LIST, OB_ERR_UNEXPECTED, stmt_list_node->type_);
|
||||
|
@ -982,7 +982,8 @@ int ObParser::parse(const ObString &query,
|
||||
ParseResult &parse_result,
|
||||
ParseMode parse_mode,
|
||||
const bool is_batched_multi_stmt_split_on,
|
||||
const bool no_throw_parser_error)
|
||||
const bool no_throw_parser_error,
|
||||
const bool is_pl_inner_parse)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
@ -1101,7 +1102,7 @@ int ObParser::parse(const ObString &query,
|
||||
}
|
||||
} else {
|
||||
ObPLParser pl_parser(*(ObIAllocator*)(parse_result.malloc_pool_), connection_collation_);
|
||||
if (OB_FAIL(pl_parser.parse(stmt, stmt, parse_result))) {
|
||||
if (OB_FAIL(pl_parser.parse(stmt, stmt, parse_result, is_pl_inner_parse))) {
|
||||
LOG_WARN("failed to parse stmt as pl", K(stmt), K(ret));
|
||||
// may create ddl func, try it.
|
||||
if ((OB_ERR_PARSE_SQL == ret
|
||||
|
@ -87,7 +87,8 @@ public:
|
||||
ParseResult &parse_result,
|
||||
ParseMode mode=STD_MODE,
|
||||
const bool is_batched_multi_stmt_split_on = false,
|
||||
const bool no_throw_parser_error = false);
|
||||
const bool no_throw_parser_error = false,
|
||||
const bool is_pl_inner_parse = false);
|
||||
|
||||
virtual void free_result(ParseResult &parse_result);
|
||||
/**
|
||||
|
@ -481,7 +481,7 @@ int ObTriggerResolver::resolve_timing_point(int16_t before_or_after, int16_t stm
|
||||
parse_result.is_for_trigger_ = 1;
|
||||
parse_result.mysql_compatible_comment_ = 0;
|
||||
parse_result.is_dynamic_sql_ = 0;
|
||||
OZ (pl_parser.parse(trigger_body, trigger_body, parse_result));
|
||||
OZ (pl_parser.parse(trigger_body, trigger_body, parse_result, true));
|
||||
CK (OB_NOT_NULL(parse_tree = parse_result.result_tree_));
|
||||
CK (T_STMT_LIST == parse_tree->type_);
|
||||
CK (1 == parse_tree->num_child_);
|
||||
|
Loading…
x
Reference in New Issue
Block a user