diff --git a/src/sql/resolver/ddl/ob_alter_table_resolver.cpp b/src/sql/resolver/ddl/ob_alter_table_resolver.cpp index 5580a58a252336f9ed6c4c5533cd78b3b9394721..bceee9a5dbbd430c897a147aafc8cb41be4d0c11 100644 --- a/src/sql/resolver/ddl/ob_alter_table_resolver.cpp +++ b/src/sql/resolver/ddl/ob_alter_table_resolver.cpp @@ -4435,7 +4435,7 @@ int ObAlterTableResolver::check_column_in_part_key(const ObTableSchema &table_sc int ret = OB_SUCCESS; // 1. to get all check table schemas, including main table schema and its' index schemas. bool is_same = false; - ObSArray check_table_schemas; + ObSArray check_table_schemas; ObSEArray simple_index_infos; ObSchemaGetterGuard *schema_guard = schema_checker_->get_schema_guard(); if (OB_ISNULL(schema_guard)) { @@ -4445,7 +4445,7 @@ int ObAlterTableResolver::check_column_in_part_key(const ObTableSchema &table_sc dst_col_schema, is_same))) { LOG_WARN("check same type alter failed", K(ret)); - } else if (table_schema.is_partitioned_table() && OB_FAIL(check_table_schemas.push_back(table_schema))) { + } else if (table_schema.is_partitioned_table() && OB_FAIL(check_table_schemas.push_back(&table_schema))) { LOG_WARN("push back schema failed", K(ret)); } else if (OB_FAIL(table_schema.get_simple_index_infos(simple_index_infos))) { LOG_WARN("get simple index infos failed", K(ret), K(table_schema)); @@ -4459,7 +4459,7 @@ int ObAlterTableResolver::check_column_in_part_key(const ObTableSchema &table_sc } else if (OB_ISNULL(index_schema)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected null index schema", K(ret), K(simple_index_infos.at(i))); - } else if (index_schema->is_partitioned_table() && OB_FAIL(check_table_schemas.push_back(*index_schema))) { + } else if (index_schema->is_partitioned_table() && OB_FAIL(check_table_schemas.push_back(index_schema))) { LOG_WARN("push back related index schema failed", K(ret)); } } @@ -4469,7 +4469,7 @@ int ObAlterTableResolver::check_column_in_part_key(const ObTableSchema &table_sc if (OB_SUCC(ret)) { const ObString &alter_column_name = src_col_schema.get_column_name_str(); for (int64_t i = 0; OB_SUCC(ret) && i < check_table_schemas.count(); i++) { - const ObTableSchema &cur_table_schema = check_table_schemas.at(i); + const ObTableSchema &cur_table_schema = *check_table_schemas.at(i); const ObColumnSchemaV2 *column_schema = nullptr; if (OB_ISNULL(column_schema = cur_table_schema.get_column_schema(alter_column_name))) { // do nothing, bacause the column does not exist in the schema.