[CP] [CP] Disable pdml when primary key has auto increment column

This commit is contained in:
hezuojiao
2024-02-08 12:30:44 +00:00
committed by ob-robot
parent 582bd4b9cb
commit 0a2a50fb59
5 changed files with 80 additions and 1 deletions

View File

@ -325,6 +325,8 @@ int ObInsertLogPlan::check_need_online_stats_gather(bool &need_osg)
ObObj online_sys_var_obj;
const ObInsertStmt *insert_stmt = NULL;
TableItem *ins_table = NULL;
bool disable_pdml = false;
bool is_pk_auto_inc = false;
if (OB_ISNULL(insert_stmt = get_stmt()) ||
OB_ISNULL(ins_table = insert_stmt->get_table_item_by_id(insert_stmt->get_insert_table_info().table_id_))) {
ret = OB_ERR_UNEXPECTED;
@ -334,6 +336,11 @@ int ObInsertLogPlan::check_need_online_stats_gather(bool &need_osg)
|| !insert_stmt->value_from_select()
|| (!get_optimizer_context().get_session_info()->is_user_session())) {
need_gathering = false;
} else if (OB_FAIL(insert_stmt->check_pdml_disabled(get_optimizer_context().is_online_ddl(),
disable_pdml, is_pk_auto_inc))) {
LOG_WARN("fail to check pdml disable for insert stmt", K(ret));
} else if (disable_pdml) {
need_gathering = false;
}
if (OB_FAIL(ret)) {