From 70c142ab232a298be74facc988c94ff6fc2c60c8 Mon Sep 17 00:00:00 2001 From: obdev Date: Wed, 22 Mar 2023 12:41:58 +0000 Subject: [PATCH] to issue<48495992>:fix core when dml stmt bulk into complex type var --- src/sql/ob_spi.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/sql/ob_spi.cpp b/src/sql/ob_spi.cpp index d468973599..f791195c93 100644 --- a/src/sql/ob_spi.cpp +++ b/src/sql/ob_spi.cpp @@ -5717,6 +5717,18 @@ int ObSPIService::get_result(ObPLExecCtx *ctx, LOG_WARN("read result error", K(ret)); } } + OX (bulk_tables.reuse()); + // fetch row阶段可能会触发udf/trigger, udf/trigger内部触发复杂数据类型内存回缩, 导致bulk table记录的table地址异常 + // 因此这里重新计算一次table 地址 + for (int64_t i = 0; OB_SUCC(ret) && i < into_count; ++i) { + ObPLCollection *table = NULL; + CK (OB_NOT_NULL(result_expr = into_exprs[i])); + CK (is_obj_access_expression(*result_expr)); + OZ (spi_calc_expr(ctx, result_expr, OB_INVALID_INDEX, &result_address)); + CK (OB_NOT_NULL(table = reinterpret_cast(result_address.get_ext()))); + CK (OB_NOT_NULL(table)); + OZ (bulk_tables.push_back(table)); + } if (OB_SUCC(ret)) { for (int64_t i = 0; OB_SUCC(ret) && i < bulk_tables.count(); ++i) { ObPLCollection *table = bulk_tables.at(i); -- GitLab