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

Version 3.x rejects previously accepted boolean string parameter for BOOLEAN field

    XMLWordPrintable

Details

    Description

      In version 2.x setting a SQL parameter value for a BOOLEAN field insert/update as follows was accepted:

      try( final PreparedStatement update = connection.prepareStatement( "UPDATE tests.datatypes SET booleanField = ?" ) ) {
        update.setObject( 1, "true", Types.BOOLEAN );
        update.execute();
      }
      

      Note that the value is a quoted string.

      In 3.x this results in:

      Incorrect integer value: 'true' for column `tests`.`datatypes`.`booleanField` at row 1
      java.sql.SQLSyntaxErrorException: (conn=11) Incorrect integer value: 'true' for column `tests`.`datatypes`.`booleanField` at row 1
              at org.mariadb.jdbc.export.ExceptionFactory.createException(ExceptionFactory.java:280)
              at org.mariadb.jdbc.export.ExceptionFactory.create(ExceptionFactory.java:368)
              at org.mariadb.jdbc.message.ClientMessage.readPacket(ClientMessage.java:137)
              at org.mariadb.jdbc.client.impl.StandardClient.readPacket(StandardClient.java:824)
              at org.mariadb.jdbc.client.impl.StandardClient.readResults(StandardClient.java:763)
              at org.mariadb.jdbc.client.impl.StandardClient.readResponse(StandardClient.java:682)
              at org.mariadb.jdbc.client.impl.StandardClient.execute(StandardClient.java:625)
              at org.mariadb.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:95)
              at org.mariadb.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:265)
      ...
      

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            cfsimplicity Julian Halliwell
            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.