Bug #96493 There are bugs in com.mysql.jdbc.StringUtils #getLong(byte [],int,int)
Submitted: 9 Aug 2019 17:00 Modified: 6 Sep 2019 13:34
Reporter: Tom Bush Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.1.* OS:Any
Assigned to: CPU Architecture:Any

[9 Aug 2019 17:00] Tom Bush
Description:
I use myslq-connectorJ with 5.1.39 version. when i defined mysql field type with varchar,and incorrectly defined java field type with Long. When mysql field value starts with a number,like "111aaa", it do not occurs error. result is 111.

How to repeat:
you can use mysql-connector with 5.* version. You need to defined java field with Long, and defined a mysql field with varchar , then insert data into mysql like "111aaa" , mysql-connectorJ will return 111.  this bug do not occurs in 6.0+

 

Suggested fix:
com.mysql.jdbc.StringUtils#getLong(byte[], int, int)
[9 Aug 2019 17:09] Tom Bush
There are bugs in com.mysql.jdbc.StringUtils #getLong(byte [],int,int)
[6 Sep 2019 13:34] Alexander Soklakov
Hi Tom,

It's the another side of Bug#82032, so I'm closing this report as a duplicate one.

But though it's a bug it will hardly be fixed in c/J 5.1 series, please use c/J 8.0 instead.