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

Inconsistency between DATE(11111) and DATE('11111')

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.5, 10.1, 10.2, 10.3, 10.4, 10.0
    • Fix Version/s: 10.4
    • Component/s: Temporal Types
    • Labels:
      None

      Description

      There is an inconsistency between casting 11111 and '11111' to DATE:

      MariaDB [test]> SELECT DATE(11111), DATE('11111');
      +-------------+---------------+
      | DATE(11111) | DATE('11111') |
      +-------------+---------------+
      | 2001-11-11  | 2011-11-01    |
      +-------------+---------------+
      1 row in set (0.00 sec)
      

      MariaDB [test]> SELECT EXTRACT(day FROM 11111), EXTRACT(day FROM '11111');
      +-------------------------+---------------------------+
      | EXTRACT(day FROM 11111) | EXTRACT(day FROM '11111') |
      +-------------------------+---------------------------+
      |                      11 |                         1 |
      +-------------------------+---------------------------+
      

      It's not clear if this is a bug, or useful behavior.
      We need to decide eventually.

        Attachments

          Activity

            People

            Assignee:
            bar Alexander Barkov
            Reporter:
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: