From de7f83230ca110bec8863bca10e1c4e4426bd5ae Mon Sep 17 00:00:00 2001 From: Zhengguo Yang <780531911@qq.com> Date: Sun, 2 Aug 2020 22:10:56 +0800 Subject: [PATCH] [Delete][Bug]fix decimal delete error (#4228) Querys like DELETE FROM tbl WHERE decimal_key <= "123.456"; when the type of decimal_key is DECIMALV2 may failed randomly, this is because the precision and scale is not initialized. --- be/src/olap/tablet_meta.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/be/src/olap/tablet_meta.cpp b/be/src/olap/tablet_meta.cpp index 7f75bc8685..edd4aaa9e3 100755 --- a/be/src/olap/tablet_meta.cpp +++ b/be/src/olap/tablet_meta.cpp @@ -125,7 +125,8 @@ TabletMeta::TabletMeta(int64_t table_id, int64_t partition_id, string data_type; EnumToString(TPrimitiveType, tcolumn.column_type.type, data_type); column->set_type(data_type); - if (tcolumn.column_type.type == TPrimitiveType::DECIMAL) { + if (tcolumn.column_type.type == TPrimitiveType::DECIMAL || + tcolumn.column_type.type == TPrimitiveType::DECIMALV2) { column->set_precision(tcolumn.column_type.precision); column->set_frac(tcolumn.column_type.scale); }