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

Allow functions for column default values

    XMLWordPrintable

Details

    Description

      With datetime we can do:

      CREATE TABLE t1 (
      updatedTime datetime DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP()
      );
      

      We should be able to use any function as a default on any data type, like this:

      CREATE TABLE t1 (
      myCol longtext DEFAULT JSON_OBJECT('a',1,'b',2),
      lottoNumber int(11) DEFAULT myUDF(),
      updatedBy varchar(255) DEFAULT CURRENT_USER() ON UPDATE CURRENT_USER()
      );
      

      Attachments

        Activity

          People

            serg Sergei Golubchik
            manjot Manjot Singh (Inactive)
            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.