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

TO_DATE: Some format error messages are more cryptic than Oracle's

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • N/A
    • 12.3
    • Server
    • None

    Description

      In some cases error messages about TO_DATE format are too generic, difficult to understand what is actually wrong. For example:

      bb-12.3-MDEV-19683-to_date-asan d5fb3dccd72d816c7181a069b91eedb3c76b2715

      MariaDB [test]> SELECT TO_DATE('March (Mar)', 'MONTH (MON)') FROM DUAL;
      ERROR 3047 (HY000): Invalid argument error: date format not recognized at MON) in function to_date.
      MariaDB [test]> show warnings;
      +-------+------+---------------------------------------------------------------------------------+
      | Level | Code | Message                                                                         |
      +-------+------+---------------------------------------------------------------------------------+
      | Error | 3047 | Invalid argument error: date format not recognized at MON) in function to_date. |
      +-------+------+---------------------------------------------------------------------------------+
      

      It looks odd because both MONTH and MON are perfectly valid format elements.
      Oracle is more user-friendly in this case:

      Oracle 21c

      ORA-01816: month may only be specified once
      

      Since such limitations aren't at all obvious – personally I can't understand why the same value is not allowed to appear twice – it would be good if the error messages were more informative.

      Attachments

        Issue Links

          Activity

            People

              elenst Elena Stepanova
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.