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

Unexpected behaviors for utf8mb4 in MariaDbClob.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 1.8.0, 2.4.0
    • Other
    • 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

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

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.