Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-8116

IMPORT TABLESPACE with different data directory fails

Details

    • Yes

    Description

      In version 5.7.13 ALTER TABLE IMPORT TABLESPACE was improved, to support importing table with different DATA DIRECTORY=. https://bugs.launchpad.net/percona-server/+bug/1548597

      In 5.7.29 this functionality stopped working, but I'm not seeing anything related in release notes, so not sure whether this is intended, or not.

      How to repeat:

       

      USE test;
      CREATE TABLE `move` (
       `id` int(11) NOT NULL,
       PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
      insert into move values(1);
      flush tables move for export;
      -- copy move.ibd and move.cfg to a different location
      -- cp data/test/move.{ibd,cfg} .
      unlock tables;
      drop table move;
      CREATE TABLE `move` (
       `id` int(11) NOT NULL,
       PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 data directory='/tmp/test/';
      alter table move discard tablespace;
      -- copy move.ibd and move.cfg to /tmp/test/test/
      -- cp move.{ibd,cfg} /tmp/test/test/
       alter table move import tablespace; 
      

      Results with different versions:

      5.7.28: works

      show create table move;
      +-------+----------------------------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table |
      +-------+----------------------------------------------------------------------------------------------------------------------------------------+
      | move | CREATE TABLE `move` (
       `id` int(11) NOT NULL,
       PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/test/' |
      +-------+----------------------------------------------------------------------------------------------------------------------------------------+

      5.7.29:

      ERROR 1808 (HY000): Schema mismatch (Table data_dir flag don't match, server table has data_dir flag = 1 and the meta-data file has data_dir flag = 0)
      

      5.7.36:

      ERROR 1808 (HY000): Schema mismatch (Table location flags do not match. The source table does not use a DATA DIRECTORY but the destination table does.)
      

       

      Attachments

        Activity

          People

            rahul.malik Rahul Malik (Inactive)
            sami.ahlroos Sami Ahlroos
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 1 day, 5 hours
                1d 5h

                Smart Checklist