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

TO_DATE: A.M. etc. elements do not work without hours, incompatibility with Oracle

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Won't Fix
    • N/A
    • N/A
    • Server
    • None
    • Not for Release Notes

    Description

      SELECT TO_DATE('P.M.','P.M.') AS x;
      SELECT TO_DATE('PM','PM') AS x;
      SELECT TO_DATE('A.M.','A.M.') AS x;
      SELECT TO_DATE('AM','AM') AS x;
      

      All these return NULL with a warning on MariaDB while work on Oracle.

      bb-12.3-MDEV-19683-to_date 7cbf7a8c641379d4318067607b71704956e87e5e

      SELECT TO_DATE('P.M.','P.M.') AS x;
      x
      NULL
      Warnings:
      Warning	1411	Incorrect datetime value: 'P.M.' for function to_date
      SELECT TO_DATE('PM','PM') AS x;
      x
      NULL
      Warnings:
      Warning	1411	Incorrect datetime value: 'PM' for function to_date
      SELECT TO_DATE('A.M.','A.M.') AS x;
      x
      NULL
      Warnings:
      Warning	1411	Incorrect datetime value: 'A.M.' for function to_date
      SELECT TO_DATE('AM','AM') AS x;
      x
      NULL
      Warnings:
      Warning	1411	Incorrect datetime value: 'AM' for function to_date
      

      Oracle

      SELECT TO_DATE('P.M.','P.M.') AS x1;
      SELECT TO_DATE('PM','PM') AS x2;
      SELECT TO_DATE('A.M.','A.M.') AS x3;
      SELECT TO_DATE('AM','AM') AS x4;
       
      X1
      01-JAN-26
       
      X2
      01-JAN-26
       
      X3
      01-JAN-26
       
      X4
      01-JAN-26
      

      Although I'm not sure why it returns 01-JAN-26 – isn't it supposed to fill it with the current date, which is Jan 22 at the time of execution?

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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