Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.4.0, 1.3.6, 1.3.7, 1.4.1, 1.4.2
    • 1.4.3
    • Other
    • None
    • MySQL server 5.6.28

    Description

      Hi,

      Since Connector/J version 1.3.6 (everything working well with 1.3.4 and 1.3.5) and
      still reproducible with version 1.4.2, there is a exception getting values from
      a '`year` year(4) DEFAULT NULL' column.

      Here is the top of the exception stack:
      {{
      java.lang.ArrayIndexOutOfBoundsException: 2
      at org.mariadb.jdbc.internal.queryresults.MariaDbValueObject.binaryDate(MariaDbValueObject.java:1019)
      at org.mariadb.jdbc.internal.queryresults.MariaDbValueObject.getDate(MariaDbValueObject.java:945)
      at org.mariadb.jdbc.internal.queryresults.MariaDbValueObject.getObject(MariaDbValueObject.java:1425)
      at org.mariadb.jdbc.MariaDbResultSet.getObject(MariaDbResultSet.java:971)
      ...
      }}

      I suspect then that the rawdata is parsed as a full date value and then failing to
      get month and day parts of it.

      Regards

      Attachments

        Activity

          diego dupin Diego Dupin added a comment -

          resulset.getObject() and resultset.getDate() is throwing ArrayIndexOutOfBoundsException for a YEAR(2) / YEAR(4) field when using prepareStatement with binary protocol (default).

          Correction is available using maven with :

          <repositories>
              <repository>
                  <id>sonatype-nexus-snapshots</id>
                  <name>Sonatype Nexus Snapshots</name>
                  <url>https://oss.sonatype.org/content/repositories/snapshots</url>
              </repository>
          </repositories>
           
          <dependencies>
              <dependency>
                  <groupId>org.mariadb.jdbc</groupId>
                  <artifactId>mariadb-java-client</artifactId>
                  <version>1.4.3-SNAPSHOT</version>
              </dependency>
          </dependencies>
          
          

          Will be release in 1.4.3.

          Corrected with commit https://github.com/MariaDB/mariadb-connector-j/commit/2dca31e7fa1fe5de56376c906dcbd5eb110fb7da
          CI : https://travis-ci.org/MariaDB/mariadb-connector-j/builds/124126382

          diego dupin Diego Dupin added a comment - resulset.getObject() and resultset.getDate() is throwing ArrayIndexOutOfBoundsException for a YEAR(2) / YEAR(4) field when using prepareStatement with binary protocol (default). Correction is available using maven with : <repositories> <repository> <id>sonatype-nexus-snapshots</id> <name>Sonatype Nexus Snapshots</name> <url>https: //oss.sonatype.org/content/repositories/snapshots</url> </repository> </repositories>   <dependencies> <dependency> <groupId>org.mariadb.jdbc</groupId> <artifactId>mariadb-java-client</artifactId> <version> 1.4 . 3 -SNAPSHOT</version> </dependency> </dependencies> Will be release in 1.4.3. Corrected with commit https://github.com/MariaDB/mariadb-connector-j/commit/2dca31e7fa1fe5de56376c906dcbd5eb110fb7da CI : https://travis-ci.org/MariaDB/mariadb-connector-j/builds/124126382

          People

            diego dupin Diego Dupin
            Patrice Patrice Duroux
            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.