From 2ad8901403a023c7aa74bca6029c477f4d84c20a Mon Sep 17 00:00:00 2001 From: hezuojiao Date: Wed, 20 Sep 2023 14:53:29 +0000 Subject: [PATCH] Fix unset bit type obj scale --- src/sql/code_generator/ob_static_engine_expr_cg.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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 c5bac57a29..3ee0fa8a47 100644 --- a/src/sql/code_generator/ob_static_engine_expr_cg.cpp +++ b/src/sql/code_generator/ob_static_engine_expr_cg.cpp @@ -276,6 +276,11 @@ int ObStaticEngineExprCG::cg_expr_basic(const ObIArray &raw_exprs) rt_expr->obj_meta_.set_has_lob_header(); } } + // For bit type, `length_semantics_` is used as width in datum mate, and `scale_` is used + // as width in obj, so passing length meta to scale in obj_mate. + if (ob_is_bit_tc(result_meta.get_type())) { + rt_expr->obj_meta_.set_scale(rt_expr->datum_meta_.length_semantics_); + } // init max_length_ rt_expr->max_length_ = raw_expr->get_result_type().get_length(); // init obj_datum_map_