Re: [sqlite] Bug: float granularity breaking unique contraint?

2018-11-02 Thread Dennis Clarke
INSERT INTO TestReal values (9223372036854775807);INSERT INTO TestReal values (9223372036854775807 - 1);INSERT INTO TestReal values (9223372036854775807 - 2);INSERT INTO TestReal values (9223372036854775807 - 3);sqlite>...>...>...>...> I recognize that number on sight and it

Re: [sqlite] Bug: float granularity breaking unique contraint?

2018-11-02 Thread David Raymond
lite-users@mailinglists.sqlite.org Subject: Re: [sqlite] Bug: float granularity breaking unique contraint? INSERT INTO TestReal values (9223372036854775807);INSERT INTO TestReal values (9223372036854775807 - 1);INSERT INTO TestReal values (9223372036854775807 - 2);INSERT INTO TestReal values (9223372036854

Re: [sqlite] Bug: float granularity breaking unique contraint?

2018-11-01 Thread David Empson
> On 2/11/2018, at 8:23 AM, James K. Lowden wrote: > > On Wed, 31 Oct 2018 23:05:19 -0300 > Bernardo Sulzbach wrote: > >> So if you are inserting integers >> into a real column, you are going to store integers. However, when you >> select from it they are presented as reals and mix up (looking

Re: [sqlite] Bug: float granularity breaking unique contraint?

2018-11-01 Thread Bernardo Sulzbach
> > I don't think that explanation holds water. > I don't have proof that I am correct, but you can try to test my hypothesis the following way: Let there be 4 databases: -- f1.db create table t(a real unique); insert into t values(9223372036854775807.0); -- f2.db create table t(a real unique);

Re: [sqlite] Bug: float granularity breaking unique contraint?

2018-11-01 Thread James K. Lowden
On Thu, 1 Nov 2018 01:18:26 +0100 szmate1618 wrote: > But there seems to be an unintended > workaround > > DROP TABLE IF EXISTS TestReal;CREATE TABLE TestReal(A REAL > UNIQUE);INSERT INTO TestReal values (9223372036854775807);INSERT INTO > TestReal values (9223372036854775807 - 1);INSERT INTO

Re: [sqlite] Bug: float granularity breaking unique contraint?

2018-10-31 Thread Bernardo Sulzbach
It is not a bug AFAIK. SQLite uses what the documentation calls dynamic typing for its actual values. So if you are inserting integers into a real column, you are going to store integers. However, when you select from it they are presented as reals and mix up (looking as if there were duplicates,

[sqlite] Bug: float granularity breaking unique contraint?

2018-10-31 Thread szmate1618
Dear SQLite people, Please bless me with your infinite wisdom. I'm using SQLite 3.25.2 on Windows, downloaded the latest precompiled binaries from the official page https://sqlite.org/download.htmlExecuting the following code DROP TABLE IF EXISTS TestReal;CREATE TABLE TestReal(A REAL