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

ADD_MONTHS with a non-integer argument gives a different result on Oracle compared to MariaDB

    XMLWordPrintable

Details

    Description

      MariaDB:

      SELECT ADD_MONTHS('1994-07-07', 2);
      +-----------------------------+
      | ADD_MONTHS('1994-07-07', 2) |
      +-----------------------------+
      | 1994-09-07                  |
      +-----------------------------+
       
      SELECT ADD_MONTHS('1994-07-07', 2.6);
      +-------------------------------+
      | ADD_MONTHS('1994-07-07', 2.6) |
      +-------------------------------+
      | 1994-10-07                    |
      +-------------------------------+
      

      Oracle:

      SELECT ADD_MONTHS('07-JUL-1994',2) FROM DUAL
      ADD_MONTHS('07-JUL-1994',2.6)
      07-SEP-94
      	
      SELECT ADD_MONTHS('07-JUL-1994',2.6) FROM DUAL	
      ADD_MONTHS('07-JUL-1994',2)
      07-SEP-94
      

      Is this intentional? Also, no warnings.

      Attachments

        Issue Links

          Activity

            People

              Gosselin Dave Gosselin
              greenman Ian Gilfillan
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.