[CONJ-558] JDBC driver adds extra .0 to DOUBLEs that MySQL driver doesn't Created: 2017-12-15 Updated: 2017-12-18 Resolved: 2017-12-18 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | JDBC 4.2 compatibility |
| Affects Version/s: | 2.2.0, 1.6.3 |
| Fix Version/s: | 2.2.1, 1.7.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Robert Dyas | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
centOS7 |
||
| Description |
|
I have a table that stores DOUBLE values. Frequently these are non-decimal values. When I issue the following query via Workbench:
Workbench gives me the expected results (importantly, so does the MySQL JDBC driver when connecting to a MySQL 5.6 database):
When I do the same via Connector/J to a MariaDB 10.1.29 database the string representation of the number via getString() adds a trailing .0 as follows:
I thought at first it might be a Connector/J or Mariadb server setting, but I can't find anything, so looks like incompatible behavior. |
| Comments |
| Comment by Diego Dupin [ 2017-12-18 ] | |||||||||||||||
|
Right, and this is inconsistent using option "useServerPrepStmts" that will not return the additional ".0". | |||||||||||||||
| Comment by Diego Dupin [ 2017-12-18 ] | |||||||||||||||
|
correction available in snapshot release :
| |||||||||||||||
| Comment by Robert Dyas [ 2017-12-18 ] | |||||||||||||||
|
Great! Just tried it, and working as expected. Thank you. New Issue: I'll make a seperate thread if its an issue and not a misunderstanding:
My connect string includes the following and was connecting to a specific IP address: &useSSL=true&trustServerCertificate=false&serverSslCert= etc That setting under 2.2.1 throws an exception and the documentation states the following:
It is unclear to me if set means set to true or false. It would seem that since I am connecting to an IP and verifying the CA that I don't need to verify a potentially non-existant host name. | |||||||||||||||
| Comment by Diego Dupin [ 2017-12-18 ] | |||||||||||||||
|
That's a because driver ensures hostname verification. If 35.224.113.70 correspond to si-mariadb-shared1-v1.parasql.com, just use this DNS name to connect. If not, the best solution would be to create an SSL certificate with correct SAN values. This validation can be avoided setting option "disableSslHostnameVerification" to true. |