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

ALTER TABLE…CHANGE col col TIMESTAMP NOT NULL DEFAULT… fails

Details

    Description

      When it comes to DEFAULT values of columns, InnoDB is imposing both unnecessary and insufficient conditions on whether ALGORITHM=INPLACE should be allowed for ALTER TABLE.

      When changing an existing column to NOT NULL, any NULL values in the columns only get a special treatment if the column is changed to an AUTO_INCREMENT column (which is not supported by ALGORITHM=INPLACE) or the column type is TIMESTAMP. In all other cases, an error must be reported for the inability to convert the NULL value to NOT NULL.

      InnoDB was unnecessarily interested in whether the DEFAULT value is not constant when altering other than TIMESTAMP columns. Also, when changing a TIMESTAMP column to NOT NULL, InnoDB was performing an insufficient check, and it was incorrectly allowing a constant DEFAULT value while not being able to replace NULL values with that constant value.

      Furthermore, in ADD COLUMN, InnoDB is unnecessarily rejecting certain nondeterministic DEFAULT expressions (depending on the session parameters or the current time).

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Marko Mäkelä made transition -
            Open In Progress
            25m 37s 1
            Marko Mäkelä made transition -
            In Progress In Review
            1m 31s 1
            Marko Mäkelä made transition -
            In Review Closed
            15h 1m 1

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.