-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 2.6.1
-
Fix Version/s: 2.7.0
-
Component/s: JDBC 4.2 compatibility
-
Labels:None
Detected at one of my clients.
They use polish special characters like ść
The length in TextRowProtocol is set to 2 for each of those characters so 4 in our example.
With this the current code
return new String(buf, pos, Math.min(maxFieldSize * 3, length), StandardCharsets.UTF_8) .substring(0, Math.min(maxFieldSize, length)); |
results into an ArrayOutOfBoundsError at the substring() call.
I added a test case and a quick fix for it.
See
https://github.com/mariadb-corporation/mariadb-connector-j/pull/156
Travis fails on environment issues. Nothing to do with my change. I can not rerun them....