Skip to content

Commit

Permalink
Return default decimal if scheme proto is empty (#13555)
Browse files Browse the repository at this point in the history
  • Loading branch information
azevaykin authored Jan 20, 2025
1 parent 55ecb5a commit 35b059a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ydb/core/scheme/scheme_types_proto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ NScheme::TTypeInfo TypeInfoFromProto(NScheme::TTypeId typeId, const ::NKikimrPro
return NScheme::TTypeInfo(NPg::TypeDescFromPgTypeId(typeInfoProto.GetPgTypeId()));
}
case NScheme::NTypeIds::Decimal: {
Y_ABORT_UNLESS(typeInfoProto.HasDecimalPrecision());
Y_ABORT_UNLESS(typeInfoProto.HasDecimalScale());
if (!typeInfoProto.HasDecimalPrecision() || !typeInfoProto.HasDecimalScale()) {
return NScheme::TTypeInfo(NScheme::TDecimalType::Default());
}
NScheme::TDecimalType decimal(typeInfoProto.GetDecimalPrecision(), typeInfoProto.GetDecimalScale());
return NScheme::TTypeInfo(decimal);
}
Expand Down

0 comments on commit 35b059a

Please sign in to comment.