fix inner expr index record operation repeatedly.

This commit is contained in:
obdev 2023-09-14 11:47:42 +00:00 committed by ob-robot
parent 1c8aa41d3e
commit 4d1b6b6059
3 changed files with 7 additions and 12 deletions

View File

@ -478,8 +478,7 @@ int ObDDLService::create_inner_expr_index(ObMySQLTransaction &trans,
const ObTableSchema &orig_table_schema, const ObTableSchema &orig_table_schema,
ObTableSchema &new_table_schema, ObTableSchema &new_table_schema,
ObIArray<ObColumnSchemaV2*> &new_columns, ObIArray<ObColumnSchemaV2*> &new_columns,
ObTableSchema &index_schema, ObTableSchema &index_schema)
const ObString *ddl_stmt_str)
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
ObSchemaGetterGuard schema_guard; ObSchemaGetterGuard schema_guard;
@ -528,7 +527,8 @@ int ObDDLService::create_inner_expr_index(ObMySQLTransaction &trans,
trans))) { trans))) {
LOG_WARN("alter table options failed", K(ret), K(new_table_schema)); LOG_WARN("alter table options failed", K(ret), K(new_table_schema));
} else if (OB_FAIL(ddl_operator.create_table( } else if (OB_FAIL(ddl_operator.create_table(
index_schema, trans, ddl_stmt_str, true, false))) { index_schema, trans, nullptr/*ddl_stmt_str*/, true, false))) {
// record the create index operation when index enables rather than schema generates.
LOG_WARN("failed to create index schema", K(ret)); LOG_WARN("failed to create index schema", K(ret));
} }
} }
@ -570,7 +570,6 @@ int ObDDLService::create_global_index(
int ObDDLService::create_global_inner_expr_index( int ObDDLService::create_global_inner_expr_index(
ObMySQLTransaction &trans, ObMySQLTransaction &trans,
const obrpc::ObCreateIndexArg &arg,
const share::schema::ObTableSchema &orig_table_schema, const share::schema::ObTableSchema &orig_table_schema,
share::schema::ObTableSchema &new_table_schema, share::schema::ObTableSchema &new_table_schema,
common::ObIArray<share::schema::ObColumnSchemaV2*> &new_columns, common::ObIArray<share::schema::ObColumnSchemaV2*> &new_columns,
@ -580,8 +579,7 @@ int ObDDLService::create_global_inner_expr_index(
if (OB_FAIL(check_inner_stat())) { if (OB_FAIL(check_inner_stat())) {
LOG_WARN("variable is not init", K(ret)); LOG_WARN("variable is not init", K(ret));
} else if (OB_FAIL(create_inner_expr_index(trans, orig_table_schema, } else if (OB_FAIL(create_inner_expr_index(trans, orig_table_schema,
new_table_schema, new_columns, index_schema, new_table_schema, new_columns, index_schema))) {
&arg.ddl_stmt_str_))) {
LOG_WARN("fail to create inner expr index", K(ret)); LOG_WARN("fail to create inner expr index", K(ret));
} }
return ret; return ret;

View File

@ -144,8 +144,7 @@ public:
const share::schema::ObTableSchema &orig_table_schema, const share::schema::ObTableSchema &orig_table_schema,
share::schema::ObTableSchema &new_table_schema, share::schema::ObTableSchema &new_table_schema,
common::ObIArray<share::schema::ObColumnSchemaV2*> &new_columns, common::ObIArray<share::schema::ObColumnSchemaV2*> &new_columns,
share::schema::ObTableSchema &index_schema, share::schema::ObTableSchema &index_schema);
const common::ObString *ddl_stmt_str);
// check whether the foreign key related table is executing offline ddl, creating index, and constrtaint task. // check whether the foreign key related table is executing offline ddl, creating index, and constrtaint task.
// And ddl should be refused if the foreign key related table is executing above ddl. // And ddl should be refused if the foreign key related table is executing above ddl.
int check_fk_related_table_ddl( int check_fk_related_table_ddl(
@ -158,7 +157,6 @@ public:
share::schema::ObTableSchema &index_schema); share::schema::ObTableSchema &index_schema);
int create_global_inner_expr_index( int create_global_inner_expr_index(
ObMySQLTransaction &trans, ObMySQLTransaction &trans,
const obrpc::ObCreateIndexArg &arg,
const share::schema::ObTableSchema &orig_table_schema, const share::schema::ObTableSchema &orig_table_schema,
share::schema::ObTableSchema &new_table_schema, share::schema::ObTableSchema &new_table_schema,
common::ObIArray<share::schema::ObColumnSchemaV2*> &new_columns, common::ObIArray<share::schema::ObColumnSchemaV2*> &new_columns,

View File

@ -306,7 +306,7 @@ int ObIndexBuilder::do_create_global_index(
} }
} else { } else {
if (OB_FAIL(ddl_service_.create_global_inner_expr_index( if (OB_FAIL(ddl_service_.create_global_inner_expr_index(
trans, new_arg, table_schema, new_table_schema, gen_columns, index_schema))) { trans, table_schema, new_table_schema, gen_columns, index_schema))) {
LOG_WARN("fail to create global inner expr index", K(ret)); LOG_WARN("fail to create global inner expr index", K(ret));
} }
} }
@ -488,8 +488,7 @@ int ObIndexBuilder::do_create_local_index(
table_schema, table_schema,
new_table_schema, new_table_schema,
gen_columns, gen_columns,
index_schema, index_schema))) {
&my_arg.ddl_stmt_str_))) {
LOG_WARN("fail to create inner expr index", K(ret)); LOG_WARN("fail to create inner expr index", K(ret));
} }
} }