O'Reilly Forums: [Linqpad] Bug: With Iq Driver, Integer Columns In Sqlite Are Always Mapped As Int32, Which Can Cause Overflows - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Linqpad] Bug: With Iq Driver, Integer Columns In Sqlite Are Always Mapped As Int32, Which Can Cause Overflows Rate Topic: -----

#1 User is offline   Thomas Levesque 

  • New Member
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 02-November 10

Posted 01 March 2012 - 01:46 AM

When you connect to a SQLite database with the IQ driver, all integer columns are mapped as Int32. But some values in the column may be outside the range of an Int32, and in that case the value silently overflows, giving incorrect results.

I realize that SQLite doesn't provide enough information to decide whether the column should be Int32, Int64 or something else (since there is only one storage class for all integer types), so to avoid this kind of issue, integer values should be mapped as Int64. Unsigned values larger than Int64.MaxValue shouldn't never occur, since SQLite only stores signed integers up to 8 bytes (http://sqlite.org/datatype3.html)

(LINQPad beta 4.38.04)

This post has been edited by Thomas Levesque: 01 March 2012 - 01:50 AM

0

#2 User is offline   darkniobe 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 17-October 12

Posted 17 October 2012 - 04:10 PM

This bug is fixed in the most recent release of the IQ driver. You now have the option in the connection configuration screen to select "Map all integers to 64bit longs".
0

#3 User is offline   Thomas Levesque 

  • New Member
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 02-November 10

Posted 18 October 2012 - 12:09 AM

View Postdarkniobe, on 17 October 2012 - 04:10 PM, said:

This bug is fixed in the most recent release of the IQ driver. You now have the option in the connection configuration screen to select "Map all integers to 64bit longs".

Cool, thanks !
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users