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

Inconsistent Alter column / modify column behavior

    XMLWordPrintable

Details

    Description

      CURRENT_TIMESTAMP can be set as DEFAULT with MODIFY but not with ALTER:

      > ALTER TABLE attachment_version ALTER COLUMN created_at SET DEFAULT CURRENT_TIMESTAMP;

      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CURRENT_TIMESTAMP' at line 1

      > ALTER TABLE attachment_version MODIFY COLUMN created_at timestamp DEFAULT CURRENT_TIMESTAMP;

      Query OK, 0 rows affected (0.02 sec)

      The table in example is InnoDB.

      Attachments

        Activity

          People

            Unassigned Unassigned
            marcin.gryszkalis Marcin Gryszkalis
            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.