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

NPE while loading a null from TIMESTAMP field using Resultset.getDate()

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • None
    • 1.4.6
    • Other
    • None

    Description

      Trying to read from a nullable TIMESTAMP field with null value:

      {{java.lang.NullPointerException: null
      at org.mariadb.jdbc.internal.queryresults.resultset.MariaSelectResultSet.binaryDate(MariaSelectResultSet.java:3259)
      at org.mariadb.jdbc.internal.queryresults.resultset.MariaSelectResultSet.getDate(MariaSelectResultSet.java:1440)
      at org.mariadb.jdbc.internal.queryresults.resultset.MariaSelectResultSet.getDate(MariaSelectResultSet.java:1351)
      at org.mariadb.jdbc.internal.queryresults.resultset.MariaSelectResultSet.getDate(MariaSelectResultSet.java:1363)}}

      The NPE is thrown here while trying to create new Date from null because rawBytes.length==0

      if you look at binaryTimestamp(...), there is already the following:

      {{if (rawBytes.length == 0)

      { return null; }

      }}

      So i guess it is just missing in this method

      Edit: oh god, jira formatting is a mess.

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            kromit Roman Kliewer
            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.