From 78c6cbd6709c877b51fff342cecd7714cadde7c9 Mon Sep 17 00:00:00 2001 From: zzg19950727 <1071026277@qq.com> Date: Fri, 4 Aug 2023 02:48:24 +0000 Subject: [PATCH] fix temp table execute bug --- src/sql/engine/basic/ob_temp_table_transformation_op.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/sql/engine/basic/ob_temp_table_transformation_op.cpp b/src/sql/engine/basic/ob_temp_table_transformation_op.cpp index ce257f1497..33d897dac1 100644 --- a/src/sql/engine/basic/ob_temp_table_transformation_op.cpp +++ b/src/sql/engine/basic/ob_temp_table_transformation_op.cpp @@ -65,8 +65,10 @@ int ObTempTableTransformationOp::inner_get_next_row() { int ret = OB_SUCCESS; clear_evaluated_flag(); + ObExecContext &ctx = get_exec_ctx(); if (init_temp_table_) { for (int64_t i = 0; OB_SUCC(ret) && i < get_child_cnt() - 1; ++i) { + int64_t temp_table_count = ctx.get_temp_table_ctx().count(); if (OB_ISNULL(children_[i])) { ret = OB_ERR_UNEXPECTED; LOG_WARN("child op is null"); @@ -75,6 +77,13 @@ int ObTempTableTransformationOp::inner_get_next_row() LOG_WARN("failed to get next row.", K(ret)); } else { ret = OB_SUCCESS; + while(OB_SUCC(ret) && ctx.get_temp_table_ctx().count() <= temp_table_count) { + if (OB_FAIL(check_status())) { + LOG_WARN("failed to wait temp table finish msg", K(ret)); + } else { + ob_usleep(1000); + } + } } } init_temp_table_ = false;