Fix temp table bugs

This commit is contained in:
xianyu-w
2024-01-19 11:43:13 +00:00
committed by ob-robot
parent 535f06bbb0
commit 22884dc072
6 changed files with 55 additions and 1 deletions

View File

@ -210,12 +210,18 @@ int ObTransformTempTable::expand_temp_table(ObIArray<TempTableInfo> &temp_table_
bool is_oversize_stmt = false;
int64_t stmt_size = 0;
bool need_expand = false;
bool can_expand = true;
OPT_TRACE("try to expand temp table:", helper.temp_table_query_);
if (OB_ISNULL(helper.temp_table_query_)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("unexpect null ref query", K(helper), K(ret));
} else if (OB_FAIL(check_stmt_size(helper.temp_table_query_, stmt_size, is_oversize_stmt))) {
LOG_WARN("check stmt size failed", K(ret));
} else if (OB_FAIL(ObTransformUtils::check_expand_temp_table_valid(helper.temp_table_query_, can_expand))) {
LOG_WARN("failed to check expand temp table valid", K(ret));
} else if (!can_expand) {
// do nothing
OPT_TRACE("CTE can not be expanded");
} else if (OB_FAIL(check_hint_allowed_trans(*helper.temp_table_query_,
force_inline,
force_materia))) {