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

Data loss when using PreparedStatement.setCharacterStream and PreparedStatement.setClob

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0, 1.1.1, 1.1.2
    • Fix Version/s: 1.1.2
    • Component/s: None
    • Labels:
      None

      Description

      setCharacterStream and setClob (when a characterStream is used) uses the wrong length of the byte buffer sent to the server. It uses the character length and not the byte length. This will lead to lost characters in the database if multibyte characters are used.

      I have attached a patch with a fix for the problem. The patch also includes some new test cases to show the problem.

        Attachments

          Activity

            People

            Assignee:
            wlad Vladislav Vaintroub
            Reporter:
            runebr Rune Bremnes
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.