Use the configuration item _ob_ddl_timeout to control the DDL timeout

This commit is contained in:
obdev
2023-09-09 13:20:11 +00:00
committed by ob-robot
parent 7b46b3a868
commit 4a94dfea00

View File

@ -4117,6 +4117,7 @@ int ObSql::parser_and_check(const ObString &outlined_stmt,
LOG_WARN("parser error number is unexpected, need disconnect", K(ret));
}
if (OB_SUCC(ret)) {
stmt::StmtType stmt_type = stmt::T_NONE;
if (OB_ISNULL(parse_result.result_tree_)) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid args", K(ret), KP(parse_result.result_tree_));
@ -4140,6 +4141,8 @@ int ObSql::parser_and_check(const ObString &outlined_stmt,
int32_t line_no = 1;
LOG_USER_ERROR(OB_ERR_PARSE_SQL, ob_errpkt_strerror(OB_ERR_PARSER_SYNTAX, false), str_len, err_msg, line_no);
LOG_WARN("the text query is invalid", K(outlined_stmt), K(children_node->value_), K(ret));
} else if (OB_FAIL(ObResolverUtils::resolve_stmt_type(parse_result, stmt_type))) {
LOG_WARN("failed to resolve stmt type", K(ret));
} else {
ObItemType type = children_node->type_;
//如果是非DML语句, 则不进入plan cache
@ -4147,6 +4150,9 @@ int ObSql::parser_and_check(const ObString &outlined_stmt,
if (T_SHOW_VARIABLES == type) {
is_show_variables = true;
}
if (ObStmt::is_ddl_stmt(stmt_type, true)) {
THIS_WORKER.set_timeout_ts(session->get_query_start_time() + GCONF._ob_ddl_timeout);
}
if (IS_DML_STMT(type) || is_show_variables) {
if (OB_UNLIKELY(NULL == (plan_cache = session->get_plan_cache()))) {
ret = OB_ERR_UNEXPECTED;