[CONJ-589] Unexpected behaviors for utf8mb4 in MariaDbClob. Created: 2018-03-16  Updated: 2019-02-08  Resolved: 2018-12-20

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: None
Fix Version/s: 1.8.0, 2.4.0

Type: Bug Priority: Major
Reporter: Jicheol Ryu Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None


 Description   

In the MariaDbClob.getSubString use java.lang.String.substring but MariaDbClob.length uses codePointCount.

It means String will be truncated unexpectedly in next code if String contains 4 byte UTF-8. because Java uses 2 chars for 4 byte unicode.

clob.getSubString(1L, (int)clob.length());

It makes issue with mybatis ClobTypeHandler.
https://github.com/mybatis/mybatis-3/blob/master/src/main/java/org/apache/ibatis/type/ClobTypeHandler.java


Generated at Thu Feb 08 03:16:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.