diff --git a/src/share/schema/ob_schema_utils.cpp b/src/share/schema/ob_schema_utils.cpp index 8bba9b3bd2..e40f1fa56c 100644 --- a/src/share/schema/ob_schema_utils.cpp +++ b/src/share/schema/ob_schema_utils.cpp @@ -1324,6 +1324,7 @@ int ObSchemaUtils::is_drop_column_only(const AlterTableSchema &alter_table_schem } return ret; } + const char* DDLType[] { "TRUNCATE_TABLE", @@ -1332,6 +1333,13 @@ const char* DDLType[] "CREATE_VIEW" }; +const char* NOT_SUPPORT_DDLType[] +{ + "SET_COMMENT", + "CREATE_INDEX", + "CREATE_VIEW" +}; + int ObParallelDDLControlMode::string_to_ddl_type(const ObString &ddl_string, ObParallelDDLType &ddl_type) { int ret = OB_SUCCESS; @@ -1449,14 +1457,25 @@ int ObParallelDDLControlMode::generate_parallel_ddl_control_config_for_create_te { int ret = OB_SUCCESS; int ddl_type_size = ARRAYSIZEOF(DDLType); - for (int i = 0; OB_SUCC(ret) && i < (ddl_type_size - 1); ++i) { - if (OB_FAIL(config_value.append_fmt("%s:ON, ", DDLType[i]))) { + int not_support_ddl_size = ARRAYSIZEOF(NOT_SUPPORT_DDLType); + config_value.reset(); + for (int i = 0; OB_SUCC(ret) && i < ddl_type_size; ++i) { + ObString tmp_str = DDLType[i]; + bool not_support = false; + for (int j = 0; OB_SUCC(ret) && j < not_support_ddl_size; ++j) { + if (tmp_str.case_compare(NOT_SUPPORT_DDLType[j]) == 0) { + not_support = true; + break; + } + } + if (not_support) { + continue; + } else if (OB_FAIL(config_value.append_fmt("%s:ON, ", DDLType[i]))) { LOG_WARN("fail to append fmt", KR(ret), K(i)); } } - if ((ddl_type_size > 0) - && FAILEDx(config_value.append_fmt("%s:ON", DDLType[ddl_type_size - 1]))) { - LOG_WARN("fail to append fmt", KR(ret), K(ddl_type_size)); + if (config_value.is_valid()) { + config_value.set_length(config_value.length()-2); } return ret; }