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

ADD CHECK leaves an orphaned .par file

    Details

      Description

      Executing ALTER TABLE ADD CHECK on a partitioned InnoDB table leaves an orphaned .par file behind. To reproduce, execute the following:

      drop database if exists orphan_par_test;
      create database orphan_par_test;
      use orphan_par_test;
      drop table if exists t;
      create table t(id int, d DATE NOT NULL, manual_override BOOL NOT NULL DEFAULT 0, primary key(id,d))
      PARTITION BY RANGE COLUMNS (d) ( 
      PARTITION p20161017 VALUES LESS THAN ('2016-10-18'),
      PARTITION p20161018 VALUES LESS THAN ('2016-10-19'));
      ALTER TABLE t ADD CHECK (b IN (0, 1));
      

      And then execute the following:

      drop database orphan_par_test;
      

      The statement will fail with the following error:

      MariaDB [orphan_par_test]> drop database orphan_par_test;
      ERROR 1010 (HY000): Error dropping database (can't rmdir './orphan_par_test', errno: 39 "Directory not empty")
      

      And we can see that the directory is non-empty because of the orphaned .par file:

      [ec2-user@ip-172-30-0-32 ~]$ sudo ls -l /var/lib/mysql/orphan_par_test/
      total 4
      -rw-rw---- 1 mysql mysql 48 Mar 28 19:01 #sql-32a_6.par
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                GeoffMontee Geoff Montee
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: