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

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.1.0, 1.1.1, 1.1.2
    • 1.1.2
    • None
    • 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

            wlad Vladislav Vaintroub
            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.