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

Incorrect comparison of null dates

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5.4
    • None
    • Temporal Types
    • None

    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

        Activity

          People

            Unassigned Unassigned
            mdierolf Mark Dierolf
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.