Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-589

Unexpected behaviors for utf8mb4 in MariaDbClob.

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.0, 1.8.0
    • Component/s: Other
    • 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

        Attachments

          Activity

            People

            • Assignee:
              diego dupin Diego Dupin
              Reporter:
              hackexpert Jicheol Ryu
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: