From 8e2e1a97e90a5c2aee3cc155cedc37f60f90afdc Mon Sep 17 00:00:00 2001 From: obdev Date: Wed, 18 Sep 2024 08:20:42 +0000 Subject: [PATCH] [CP] [ARRAY] disable array function index --- src/share/ob_index_builder_util.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/share/ob_index_builder_util.cpp b/src/share/ob_index_builder_util.cpp index bceb048150..2ada7606ba 100644 --- a/src/share/ob_index_builder_util.cpp +++ b/src/share/ob_index_builder_util.cpp @@ -818,7 +818,7 @@ int ObIndexBuilderUtil::adjust_ordinary_index_column_args( ObArenaAllocator allocator(ObModIds::OB_SQL_EXPR); ObRawExprFactory expr_factory(allocator); SMART_VAR(sql::ObSQLSessionInfo, session) { - SMART_VAR(sql::ObExecContext, exec_ctx, allocator) { + SMART_VARS_2((sql::ObExecContext, exec_ctx, allocator), (ObPhysicalPlanCtx, phy_plan_ctx, allocator)) { uint64_t tenant_id = data_schema.get_tenant_id(); const ObTenantSchema *tenant_schema = NULL; ObSchemaGetterGuard guard; @@ -827,6 +827,7 @@ int ObIndexBuilderUtil::adjust_ordinary_index_column_args( LinkExecCtxGuard link_guard(session, exec_ctx); exec_ctx.set_my_session(&session); exec_ctx.set_is_ps_prepare_stage(false); + exec_ctx.set_physical_plan_ctx(&phy_plan_ctx); if (OB_FAIL(session.init(0 /*default session id*/, 0 /*default proxy id*/, &allocator))) { @@ -873,6 +874,9 @@ int ObIndexBuilderUtil::adjust_ordinary_index_column_args( } else if (ob_is_json_tc(expr->get_result_type().get_type())) { ret = OB_ERR_FUNCTIONAL_INDEX_ON_JSON_OR_GEOMETRY_FUNCTION; LOG_WARN("Cannot create a functional index on an expression that returns a JSON or GEOMETRY.",K(ret)); + } else if (ob_is_collection_sql_type(expr->get_result_type().get_type())) { + ret = OB_ERR_FUNCTIONAL_INDEX_ON_FIELD; + LOG_WARN("Cannot create a functional index on an expression that returns a ARRAY.",K(ret)); } else if (ob_is_text_tc(expr->get_result_type().get_type()) || ob_is_lob_tc(expr->get_result_type().get_type())) { ret = OB_ERR_FUNCTIONAL_INDEX_ON_LOB; LOG_WARN("Cannot create a functional index on an expression that returns a BLOB or TEXT.", K(ret)); @@ -923,6 +927,7 @@ int ObIndexBuilderUtil::adjust_ordinary_index_column_args( ret = OB_ERR_FUNCTIONAL_INDEX_ON_FIELD; LOG_WARN("Functional index on a column is not supported.", K(ret), K(*expr)); } + exec_ctx.set_physical_plan_ctx(NULL); } } }