On Dec 13, 2009, at 3:16 PM, Alexey Pechnikov wrote:
> As we can see, the unique index can check equlity of REAL values
> but the "=" operator can not. it's fantastic I think :-)
The problem is not the "=" operator...
sqlite> create table test (save_date REAL unique);
sqlite> insert into test values (julianday('now'));
sqlite> select rowid,* from test;
1|2455179.42227787
sqlite> insert into test select * from test;
SQL error: column save_date is not unique
sqlite> select count(*) from test where save_date=2455179.42227787;
0
sqlite> select count(*) from test where save_date in (select save_date from
test where rowid=1);
1
sqlite>
The problem is that floating point values (in SQLite shell) do not have
write-read idempotency. I have moaned about that on this mailing list for
years! ;-)
http://www.mail-archive.com/[email protected]/msg09529.html
e
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users