Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using SQLite to store some data. The primary database is on a NAS (Debian Lenny, 2.6.15, armv4l) since the NAS runs a script which updates the data every day. A typical "select * from tableX" looks like this:


When I copy the DB to my main computer (Mac OS X) and run the same SQL query, the output is:


The 3rd and 4th column have the type REAL. Interesting fact: When the numbers are integer (i.e. they end with ".0"), there is no difference between the two databases. In all other cases, the differences are ... hm ... surprising? I can't seem to find a pattern.

If someone's got a clue - please share!

share|improve this question
My only guess is the data type is getting read out incorrectly, possibly due to a version conflict between the two DBs. Try storing a record on the Mac and then reading it from Debian and see if the behaviour is consistent. If it is consistent, then you'll find your data is actually fine, but a platform inconsistency is causing this. – user3463 Dec 27 '10 at 17:53
Just tried that - same effect but vice versa. When I store values on the Mac and run a select query on the Debian machine, I get these insanely high or low floats. – pruefsumme Dec 27 '10 at 18:15
sqlite3 versions: 3.5.9 (Debian), 3.6.12 (Mac) – pruefsumme Dec 27 '10 at 18:16
Maybe one of your sqlite installs had some unusual compile time options. You can find out by typing PRAGMA compile_options; in the sqlite shell. I'm wondering if it has something to do with malloc byte alignment. – Mike Fitzpatrick Dec 28 '10 at 23:41
this has no effect (i.e. doesn't return anything) sqlite> PRAGMA compile_options; sqlite> – pruefsumme Dec 29 '10 at 16:05

You must log in to answer this question.

Browse other questions tagged .