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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 5.5, 10.0, 10.1, 10.2, 10.3, 10.4
    • 10.4
    • Temporal Types
    • 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

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.