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

MySQLPreparedStatement.setObject cannot handle java.lang.Character type

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 2.6.2
    • 2.7.0
    • Other
    • None

    Description

      BasePrepareStatement.setObject() doesn't handle the Character data type, resulting in it falling back to sending the serialized version of the Character object.

      This is of course compliant with JDBC, which does not define a mapping for the Character data type; however, since this was present in a previous version of the driver, upgrading broke our application and we had to deploy a workaround.

      Attachments

        Issue Links

          Activity

            Ah yes, of course. The previous report was referring to a different signature of setObject().

            Do you need a PR?

            vmsh0 Riccardo Paolo Bestetti added a comment - Ah yes, of course. The previous report was referring to a different signature of setObject(). Do you need a PR?
            diego dupin Diego Dupin added a comment -

            This is slightly different from CONJ-185 where targetSqlType was set to java.sql.Types.CHAR value, but with String object.

            setObject(final int parameterIndex, final Object x, final int targetSqlType)
            

            Here is handling char / java.lang.Character Object. I don't know if this was supported of not, I've not found any code change that could have refer to this part. In all case, there is no reason not to support char / java.lang.Character parameters.

            diego dupin Diego Dupin added a comment - This is slightly different from CONJ-185 where targetSqlType was set to java.sql.Types.CHAR value, but with String object. setObject( final int parameterIndex, final Object x, final int targetSqlType) Here is handling char / java.lang.Character Object. I don't know if this was supported of not, I've not found any code change that could have refer to this part. In all case, there is no reason not to support char / java.lang.Character parameters.

            People

              diego dupin Diego Dupin
              vmsh0 Riccardo Paolo Bestetti
              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.