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

New DEFAULT logic does not support use of some suitable functions

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 10.2(EOL)
    • 10.2.2
    • OTHER
    • None

    Description

      There seems to be no obvious good reason why

      • MONTHNAME(..)
      • DAYNAME(...)
      • DATE_FORMAT(...)
      • TIME_FORMAT(...)

      should not work in DEFAULT clause, so it's worth checking whether it was intended:

      MariaDB [test]> create table t1 (d datetime default current_timestamp, m varchar(16) default monthname(d));
      ERROR 1901 (HY000): Function or expression 'monthname()' cannot be used in the DEFAULT clause of `m`
      

      Especially since MONTH() works:

      MariaDB [test]> create or replace table t1 (d datetime default current_timestamp, m varchar(16) default month(d));
      Query OK, 0 rows affected (0.58 sec)
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              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.