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

the feature "Return null for 'zero' timestamps" while return a wrong result when call ResultSet.wasNull().

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.8
    • Component/s: None
    • Labels:
      None
    • Environment:
      when we select a record from a table and the value of timestamp field is '0000-00-00 00:00:00', the result of this field is null, that's OK. but when we call wasNull(), is return false.

      Description

      test code :
      public Object getResult(ResultSet rs, String columnName)
      throws SQLException {
      java.sql.Timestamp sqlTimestamp = rs.getTimestamp(columnName);
      if (rs.wasNull())

      { return null; }

      else

      { return new java.util.Date(sqlTimestamp.getTime()); }

      }

      when the value of the field 'columnName' is '0000-00-00 00:00:00', rs.wasNull() will return false, not true. it is wrong.

        Attachments

          Activity

            People

            Assignee:
            massimo.siani Massimo Siani (Inactive)
            Reporter:
            mousehouse Han Yinghan
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.