Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-23243

.NET: LINQ: Value was either too large or too small for a Decimal

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • 3.0
    • None
    • Docs Required, Release Notes Required

    Description

      IGNITE-21743 generates SQL with DECIMAL(60, 30) casts, but the resulting values might exceed maximum decimal precision in .NET (28-29 digits).

      After IGNITE-23192 fix, TestCastToDecimalPrecision fails:

      System.OverflowException : Value was either too large or too small for a Decimal.
      10:07:15            at System.Numerics.BigInteger.op_Explicit(BigInteger value)
                 at Apache.Ignite.Internal.Proto.BinaryTuple.BinaryTupleReader.ReadDecimalUnscaled(ReadOnlySpan`1 span, Int32 scale) in /opt/buildagent/work/b8d4df1365f1f1e5/modules/platforms/dotnet/Apache.Ignite/Internal/Proto/BinaryTuple/BinaryTupleReader.cs:line 569
                 at Apache.Ignite.Internal.Proto.BinaryTuple.BinaryTupleReader.ReadDecimal(ReadOnlySpan`1 span, Int32 scale) in /opt/buildagent/work/b8d4df1365f1f1e5/modules/platforms/dotnet/Apache.Ignite/Internal/Proto/BinaryTuple/BinaryTupleReader.cs:line 563
                 at Apache.Ignite.Internal.Proto.BinaryTuple.BinaryTupleReader.GetDecimalNullable(Int32 index, Int32 scale) in /opt/buildagent/work/b8d4df1365f1f1e5/modules/platforms/dotnet/Apache.Ignite/Internal/Proto/BinaryTuple/BinaryTupleReader.cs:line 264
                 at SingleColumnFromBinaryTupleReader_System.Nullable`1[[System.Decimal, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]_57(IReadOnlyList`1 , BinaryTupleReader& )
                 at Apache.Ignite.Internal.Sql.ResultSet`1.ReadRow(IReadOnlyList`1 cols, MsgPackReader& reader)
                 at Apache.Ignite.Internal.Sql.ResultSet`1.<>c__DisplayClass37_0.<<EnumerateRows>g__EnumeratePage|0>d.MoveNext()
                 at Apache.Ignite.Internal.Sql.ResultSet`1.EnumerateRows()+MoveNext()
                 at Apache.Ignite.Internal.Sql.ResultSet`1.EnumerateRows()+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
                 at Apache.Ignite.Internal.Linq.IgniteQueryExecutor.ExecuteCollection[T](QueryModel queryModel)+MoveNext()
                 at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
                 at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
                 at Apache.Ignite.Tests.Linq.LinqTests.TestCastToDecimalPrecision()
      

      Attachments

        Issue Links

          Activity

            People

              ptupitsyn Pavel Tupitsyn
              ptupitsyn Pavel Tupitsyn
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: