Page 1 of 1

Arithmetic operation resulted in an overflow

Posted: Thu 06 Sep 2012 14:56
by dilbert
I'm using dotConnect for SQLite 4.1.58.
I got following error:

Code: Select all

Arithmetic operation resulted in an overflow.

at MaterializeFigure(MaterializerScope )
   at Devart.Data.Linq.Engine.ObjectReader`1.a()
   at Devart.Data.Linq.Engine.EntityReader`3.a()
   at Devart.Data.Linq.Engine.ObjectReader`1.a(T& A_0)
   at Devart.Data.Linq.Engine.ObjectReader`1.g()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
with simple query:

Code: Select all

from fq in DB.FigureQuestions
where fq.Id_question == idQuestion
select fq.Figures).ToList<Figure>();
It occurs only in SQLite (with dotConnect for MySql it works correctly, with older versions 3.x it works properly as well).

I sent you sample project for reproducing this problem through your contact form.

(Tested also with today released version 4.2.27. Same exception thrown.)

Re: Arithmetic operation resulted in an overflow

Posted: Fri 07 Sep 2012 10:26
by MariiaI
Thank you for the sample project. We have reproduced this issue. We will investigate it and inform you about the results as soon as possible.

Re: Arithmetic operation resulted in an overflow

Posted: Tue 11 Sep 2012 15:52
by StanislavK
We have analyzed the test project. The problem is that the 'add_text' column of the 'exam_figure' table is mapped to a property of the 'sbyte?' type, but a row in the table has the value larger than 127 in its 'add_text' cell. Thus, the error occurs when trying to assign this value to the 'sbyte?' AddText property of an ExamFigure object.

To resolve the issue, you can either map the AddText property to, e.g., Int32, or ensure that the table contains only proper 'sbyte' values.

Re: Arithmetic operation resulted in an overflow

Posted: Thu 13 Sep 2012 07:15
by dilbert
Oh, of course. My fault :oops:
Thank you for finding out the problem and my apologies for wasting your time.