google-code-export / sqljet

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

No integer-real type coercion in index query #151

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Create a table with a REAL field

db.createTable("CREATE TABLE record (a REAL NOT NULL)");
db.createIndex("CREATE INDEX record_idx ON record (a)");

2. Populate with elements:

for (int a = 0; a < 10; ++a) table.insert((double)a);

3. Query with index lookup() or scope() using INTEGER values

cursor = table.scope("record_idx", new Object[] { 2 }, new Object[] { 5 });
cursor = table.lookup("record_idx", 2);

What is the expected output? What do you see instead?

Expect to get records in range, but none match.  Same behavior occurs if index 
query values are of REAL type but values inserted into field were of integer 
type (that is, for (int a = 0; a < 10; ++a) table.insert(a);).

What version of the product are you using? On what operating system?

1.0.3.b914.

Please provide any additional information below.

If indexing operations don't work without values being stored in exactly the 
same format as the query values, that should be clearly documented.  But it 
would also be an incompatibility with Sqlite, since Sqlite indices convert 
between real and integer types as expected.

Original issue reported on code.google.com by cdemarc...@gmail.com on 19 Mar 2011 at 5:16

GoogleCodeExporter commented 9 years ago

Original comment by sergey.s...@gmail.com on 20 Mar 2011 at 3:49

GoogleCodeExporter commented 9 years ago
This issue is fixed now both in trunk and 1.0.x branch.

Original comment by kit...@gmail.com on 23 Mar 2011 at 2:08