Fix ctas if not exists failed if table exists

This commit is contained in:
Hongqin-Li 2023-04-19 07:45:00 +00:00 committed by ob-robot
parent 8a25c39f85
commit 8d1f639f7c

View File

@ -433,6 +433,10 @@ int ObCreateTableExecutor::execute_ctas(ObExecContext &ctx,
LOG_DEBUG("CTAS all done", K(ins_sql), K(affected_rows), K(lib::is_oracle_mode()));
}
if (OB_ERR_TABLE_EXIST == ret && create_table_arg.if_not_exist_) {
ret = OB_SUCCESS;
LOG_DEBUG("table exists, force return success after cleanup", K(create_table_name));
}
} else {
LOG_DEBUG("table exists, no need to CTAS", K(create_table_res.table_id_));
}