Arithmetic operation resulted in an overflow

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
dilbert
Posts: 68
Joined: Tue 28 Apr 2009 10:11

Arithmetic operation resulted in an overflow

Post by dilbert » Thu 06 Sep 2012 14:56

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.)

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Arithmetic operation resulted in an overflow

Post by MariiaI » Fri 07 Sep 2012 10:26

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.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Re: Arithmetic operation resulted in an overflow

Post by StanislavK » Tue 11 Sep 2012 15:52

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.

dilbert
Posts: 68
Joined: Tue 28 Apr 2009 10:11

Re: Arithmetic operation resulted in an overflow

Post by dilbert » Thu 13 Sep 2012 07:15

Oh, of course. My fault :oops:
Thank you for finding out the problem and my apologies for wasting your time.

Post Reply