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

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 1.1.8
    • None
    • None
    • 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

            massimo.siani Massimo Siani (Inactive)
            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.