Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-25771

Incorrect comparison of null dates

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.5.4
    • N/A
    • Temporal Types
    • None
    • Not for Release Notes

    Description

      Date comparisons involving null values are not working properly even in strict mode, or when NO_ZERO_DATE is defined.

      testing> SET SESSION sql_mode = 'STRICT_ALL_TABLES';
      testing> SELECT CAST('2031-33-99' as date), CAST('2021-05-25' as date), CAST('2031-33-99' as date) < CAST('2021-05-25' as date), CAST(null as date) < CAST('2021-05-25' as date), null < CAST('2021-05-25' as date)\G
      **************************[ 1. row ]**************************
      CAST('2031-33-99' as date) | <null>
      CAST('2021-05-25' as date) | 2021-05-25
      CAST('2031-33-99' as date) < CAST('2021-05-25' as date) | 1
      CAST(null as date) < CAST('2021-05-25' as date) | <null>
      null < CAST('2021-05-25' as date) | <null>

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mdierolf Mark Dierolf
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.