From a8a604e10eb962f717b66eee43c4cbf9cda7bb92 Mon Sep 17 00:00:00 2001 From: obdev Date: Tue, 10 May 2022 15:50:28 +0800 Subject: [PATCH] [CP] when column default is , add plan fail --- src/sql/code_generator/ob_static_engine_expr_cg.cpp | 3 +++ src/sql/rewrite/ob_transform_where_subquery_pullup.cpp | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/sql/code_generator/ob_static_engine_expr_cg.cpp b/src/sql/code_generator/ob_static_engine_expr_cg.cpp index d088111176..baf27ddfda 100644 --- a/src/sql/code_generator/ob_static_engine_expr_cg.cpp +++ b/src/sql/code_generator/ob_static_engine_expr_cg.cpp @@ -701,6 +701,9 @@ int ObStaticEngineExprCG::alloc_const_frame( ObDatum* datum = reinterpret_cast(frame_mem + j * DATUM_EVAL_INFO_SIZE); datum->ptr_ = frame_mem + rt_expr->res_buf_off_; datum->from_obj(tmp_obj); + if (0 == datum->len_) { + datum->ptr_ = NULL; + } } } if (OB_SUCC(ret) && OB_FAIL(frame_ptrs.push_back(frame_mem))) { diff --git a/src/sql/rewrite/ob_transform_where_subquery_pullup.cpp b/src/sql/rewrite/ob_transform_where_subquery_pullup.cpp index d01bce21e3..026750a1f4 100644 --- a/src/sql/rewrite/ob_transform_where_subquery_pullup.cpp +++ b/src/sql/rewrite/ob_transform_where_subquery_pullup.cpp @@ -2232,7 +2232,11 @@ int ObWhereSubQueryPullup::get_single_set_subquery( if (OB_ISNULL(expr)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("expr is null", K(ret)); - } else if (expr->has_flag(IS_WITH_ANY) || expr->has_flag(IS_WITH_ALL) || expr->has_hierarchical_query_flag() || + } else if (expr->has_flag(IS_WITH_ANY) || + expr->has_flag(IS_WITH_ALL) || + T_OP_EXISTS == expr->get_expr_type() || + T_OP_NOT_EXISTS == expr->get_expr_type() || + expr->has_hierarchical_query_flag() || !expr->has_flag(CNT_SUB_QUERY)) { } else if (!expr->is_query_ref_expr()) { for (int64_t i = 0; OB_SUCC(ret) && i < expr->get_param_count(); ++i) { -- GitLab