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

Dropping column from table that is part of a key fails in 10.2.8

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.2.8
    • N/A
    • Documentation
    • None
    • Docker version 17.06.0-ce, build 02c1d87 running on OSX 10.12.4 (16E195)
      Docker image SHA: 801ba73f78da191339d1cf2acdb98f2ea6fe2d38974e838a4a5f1535563e4ed7

    Description

      In the 10.2.8 update the following script will fail. When testing against 10.2.7 it will not fail indicating a regression between bugfix versions.

      Test Case

      create table X (
        A int,
        b int,
        primary key (A,B)
      );
       
      ALTER TABLE X DROP COLUMN A;
      

      Expected Result

      The column is dropped from the table

      Actual Result

      An error is returned

      [42000][1072] Key column 'A' doesn't exist in table
      

      In 10.2.7 docker, as specified by the sha 8ea33570152349b827d7121b88dc3f44a64e1cc7646cfae01faee4824b9b0007 the above script will work and drop the column.

      Attachments

        Issue Links

          Activity

            Yes, enhanced documentation.

            The changed behavior was a result of the bug fix, namely, old behavior was considered a bug.
            Of course, one can argue that any bug fix is a "change in behavior" and "introduces incompatibility", even if it fixes a crash.

            serg Sergei Golubchik added a comment - Yes, enhanced documentation. The changed behavior was a result of the bug fix, namely, old behavior was considered a bug. Of course, one can argue that any bug fix is a "change in behavior" and "introduces incompatibility", even if it fixes a crash.
            todd.farmer Todd Farmer added a comment -

            Maybe the documentation can be linked, and the JIRA component updated to show that what was "fixed" was just documentation? Right now, it references "Data Definition - Alter Table", which - when coupled with the "Fixed" resolution - suggests behavior was changed.

            When your bug fix for CHECK CONSTRAINT code changes behavior that triggers schema preparation scripts to fail - as it did for Cloudera Manager - in a maintenance release, when CHECK CONSTRAINTS aren't in use, I will argue that it's most certainly an introduced incompatibility.

            todd.farmer Todd Farmer added a comment - Maybe the documentation can be linked, and the JIRA component updated to show that what was "fixed" was just documentation? Right now, it references "Data Definition - Alter Table", which - when coupled with the "Fixed" resolution - suggests behavior was changed. When your bug fix for CHECK CONSTRAINT code changes behavior that triggers schema preparation scripts to fail - as it did for Cloudera Manager - in a maintenance release, when CHECK CONSTRAINTS aren't in use, I will argue that it's most certainly an introduced incompatibility.
            todd.farmer Todd Farmer added a comment -

            Thanks - you may also consider adding a note in the 10.2 incompatibilities documentation.

            todd.farmer Todd Farmer added a comment - Thanks - you may also consider adding a note in the 10.2 incompatibilities documentation .

            You're right. Sorry for confusion.

            "Component" is now Documentation.
            The clarification was added to https://mariadb.com/kb/en/library/alter-table/#drop-column

            The bug was that DROP COLUMN X in some cases implicitly meant "add new UNIQUE constraint to the column Y". Now if you want all values in the column Y be unique, you need to add a unique constraint explicitly, it won't automagically appear because of some unrelated operation.

            serg Sergei Golubchik added a comment - You're right. Sorry for confusion. "Component" is now Documentation. The clarification was added to https://mariadb.com/kb/en/library/alter-table/#drop-column The bug was that DROP COLUMN X in some cases implicitly meant "add new UNIQUE constraint to the column Y". Now if you want all values in the column Y be unique, you need to add a unique constraint explicitly, it won't automagically appear because of some unrelated operation.
            todd.farmer Todd Farmer added a comment -

            Thank you again.

            I understand you are referencing MySQL Bug#17098. I agree with the assertion that the historical behavior is inappropriate and non-compliant with standards. I disagree with the decision to make such a change in a maintenance release. I'd argue that behavioral changes such as this should only be made in maintenance releases when the consequences of the defect are severe (data loss, service availability,etc,), and that standards compliance enhancements be reserved for major/minor releases.

            todd.farmer Todd Farmer added a comment - Thank you again. I understand you are referencing MySQL Bug#17098 . I agree with the assertion that the historical behavior is inappropriate and non-compliant with standards. I disagree with the decision to make such a change in a maintenance release. I'd argue that behavioral changes such as this should only be made in maintenance releases when the consequences of the defect are severe (data loss, service availability,etc,), and that standards compliance enhancements be reserved for major/minor releases.

            People

              greenman Ian Gilfillan
              pathompson Paul Thompson
              Votes:
              0 Vote for this issue
              Watchers:
              7 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.