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

sql_mode=ORACLE: Add/Subtract numbers from date

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4.6
    • 10.4
    • PL/SQL
    • None
    • Windows

    Description

      In the ORACLE-Mode there is a problem with subtract / add from dates to sysdate

      e.g. in Oracle

      select sysdate - 7 from dual;
      

      I get the value, when today is the 02.07.2019:

      25.06.19 16:25:28
      

      When I try this in MariaDB

      select sysdate() -7;
      

      I get the text/number

      +----------------+
      | sysdate() -7   |
      +----------------+
      | 20190702162697 |
      +----------------+
      1 row in set (0.001 sec)
      

      correct is

      +---------------------+
      | sysdate() -7        |
      +---------------------+
      | 2019-06-25 16:27:29 |
      +---------------------+
      1 row in set (0.001 sec)
      

      The reason is that in Oracle subtractions the day is subtracted and not then seconds.

      Attachments

        Activity

          People

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