[CP] [CP] fix temporary table cleaning bug

This commit is contained in:
wjhh2008
2023-05-30 04:16:56 +00:00
committed by ob-robot
parent 46a1053175
commit 1108314cc9

View File

@ -10676,6 +10676,8 @@ int ObDMLResolver::generate_check_constraint_exprs(const TableItem *table_item,
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get unexpected null", K(ret), K(params_.session_info_), K(params_.allocator_));
} else {
bool is_temp_table_clean = params_.session_info_->is_inner() && OB_NOT_NULL(table_schema)
&& table_schema->is_oracle_tmp_table();
for (ObTableSchema::const_constraint_iterator iter = table_schema->constraint_begin(); OB_SUCC(ret) &&
iter != table_schema->constraint_end(); iter ++) {
ObRawExpr *check_constraint_expr = NULL;
@ -10687,7 +10689,7 @@ int ObDMLResolver::generate_check_constraint_exprs(const TableItem *table_item,
continue;
} else if (!(*iter)->get_enable_flag() &&
(*iter)->is_validated() &&
!resolve_check_for_optimizer) {
!resolve_check_for_optimizer && !is_temp_table_clean) {
const ObSimpleDatabaseSchema *database_schema = NULL;
if (OB_ISNULL(params_.schema_checker_->get_schema_guard())) {
ret = OB_ERR_UNEXPECTED;