BigDecimal Bug in MonetDB JDBC Driver
Hello developers, I found a bug when using BigDecimals in prepared statements with MonetDB¹s JDBC driver. If I have a column of type DECIMAL(15,2) and insert a big decimal with the value 627000.00 through a PreparedStatement, it will turn out as 630000.00 in the DB, since the MonetDB JDBC driver currently mixes up "precision" and "scale", and rounds 627000.00 to a precision of 2 ciphers. I made a bugfix for it, and it can be seen here: https://github.com/shaagerup/monet-jdbc/commit/ ebc5e654dc28e3b56d4c4b610d3d339e675d6c2c I¹m sorry for not committing it directly to your repository, but since I am not a Mercurial user, I hope someone else will use this information to improve the official JDBC driver. Best regards Søren Haagerup
Hi Søren, thank you for your patch, I have added it to the MonetDB repository. https://dev.monetdb.org/hg/MonetDB/rev/3ea8fee77829 Hannes
On 29 Oct 2015, at 13:46, Søren Haagerup
wrote: Hello developers,
I found a bug when using BigDecimals in prepared statements with MonetDB¹s JDBC driver.
If I have a column of type DECIMAL(15,2) and insert a big decimal with the value 627000.00 through a PreparedStatement, it will turn out as 630000.00 in the DB, since the MonetDB JDBC driver currently mixes up "precision" and "scale", and rounds 627000.00 to a precision of 2 ciphers.
I made a bugfix for it, and it can be seen here: https://github.com/shaagerup/monet-jdbc/commit/ ebc5e654dc28e3b56d4c4b610d3d339e675d6c2c
I¹m sorry for not committing it directly to your repository, but since I am not a Mercurial user, I hope someone else will use this information to improve the official JDBC driver.
Best regards Søren Haagerup
_______________________________________________ developers-list mailing list developers-list@monetdb.org https://www.monetdb.org/mailman/listinfo/developers-list
participants (2)
-
Hannes Mühleisen
-
Søren Haagerup