xerial / sqlite-jdbc

SQLite JDBC Driver
Apache License 2.0
2.82k stars 615 forks source link

ROUND function not working as expected #974

Closed joc-a closed 1 year ago

joc-a commented 1 year ago

Describe the bug ROUND function is not working as expected. More details below.

To Reproduce Run this in DataGrip with driver Xerial SQLiteJDBC v0.43.0.0

DROP TABLE IF EXISTS fakeTable;
CREATE TABLE IF NOT EXISTS fakeTable (id INTEGER PRIMARY KEY AUTOINCREMENT);
INSERT INTO fakeTable  DEFAULT VALUES;
SELECT ROUND(10.555, 2) FROM fakeTable;

Expected behaviour Expected result: 10.56. Actual result: 10.55

Logs If applicable, provide logs.

Environment (please complete the following information):

Additional context Tested using DataGrip with driver Xerial SQLiteJDBC v0.43.0.0

Screenshot 2023-09-12 at 3 37 28 PM
gotson commented 1 year ago

Not sure to understand, your issue doesn't mention or show any sqlite-jdbc code, only sqlite sql.

joc-a commented 1 year ago

Not sure to understand, your issue doesn't mention or show any sqlite-jdbc code, only sqlite sql.

@gotson Sorry, I added more info under Additional context.

gotson commented 1 year ago

Still doesn't explain what it has to do with the driver itself.

Do you get same results in sqlite cli?

joc-a commented 1 year ago

Apologies for jumping to the conclusion that there is a problem with the driver. It appears to be a problem with SQLite and someone has already reported it. Here is the comparison between the CLI results for v3.39.5 and v3.43.1.

Screenshot 2023-09-12 at 4 30 25 PM

vs

Screenshot 2023-09-12 at 4 37 08 PM