google-code-export / sqljet

Automatically exported from code.google.com/p/sqljet
0 stars 1 forks source link

Getting DOUBLE values from table results in NumberFormatException #171

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create an SQLite database table containing a Double field and at least one 
value with decimal point (e.g. 1.11)
2. get an ISqlJetCursor on your table and call cursor.getFloat(2) (for the 
third field in my case)
3. you'll get a stack trace like:
java.lang.NumberFormatException: For input string: "1.11"
     at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
     at java.lang.Long.parseLong(Long.java:419)
     at java.lang.Long.valueOf(Long.java:525)
     at org.tmatesoft.sqljet.core.internal.SqlJetUtility.atoi64(SqlJetUtility.java:919)
     at org.tmatesoft.sqljet.core.internal.vdbe.SqlJetVdbeMem.applyNumericAffinity(SqlJetVdbeMem.java:1196)
         ...

What is the expected output? What do you see instead?
Double values in SQLite should be parsed into Double or Float variables. From 
the stack trace it seem that Long.valueOf() is being used, creating an error 
with decimal numbers.

What version of the product are you using? On what operating system?
I'm using SqlJet 1.1.5 on Java 1.6.0 on Mac OS 10.6.8

Please provide any additional information below.
I'm using SqlJet from within Fiji ( http://fiji.sc/ )

Original issue reported on code.google.com by jan.egli...@gmail.com on 19 Dec 2012 at 3:36

GoogleCodeExporter commented 9 years ago

Original comment by sergey.s...@gmail.com on 19 Dec 2012 at 3:39

GoogleCodeExporter commented 9 years ago
I've commited a fix into 'trunk' repository. It should be included into next 
minor update release.

Original comment by sergey.s...@gmail.com on 22 Dec 2012 at 4:23

GoogleCodeExporter commented 9 years ago

Original comment by sergey.s...@gmail.com on 12 Feb 2013 at 5:31