[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.
This commit is contained in:
Zhengguo Yang
2020-08-02 22:10:56 +08:00
committed by GitHub
parent 5caa347e86
commit de7f83230c

View File

@ -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);
}