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

Incorrect comparison of null dates

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.5.4
    • Fix Version/s: None
    • Component/s: Temporal Types
    • Labels:
      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

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

              Dates

              Created:
              Updated:

                Git Integration