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

'Data structure corruption' IMPORT TABLESPACE doesn't work for encrypted InnoDB tables if space_id changed

    XMLWordPrintable

Details

    • 10.2.4-5

    Description

      So I do following actions on encrypted InnoDB :
      [mysqld]
      plugin_load=file_key_management.so
      file_key_management_encryption_algorithm=aes_cbc
      file_key_management_filename=/sec/keys.enc
      file_key_management_filekey=secret
      innodb-buffer-pool-size=128M
      innodb-encrypt-log=ON
      innodb-encryption-rotate-key-age=2
      innodb-encryption-threads=4
      innodb-tablespaces-encryption
      innodb-encrypt-tables=FORCE

      root@c480fbb475db:/test# mysql <<EOL
      create database d1;
      use d1;
      create table t(a varchar(5)) encrypted=yes encryption_key_id=1;
      EOL
      root@c480fbb475db:/test# cp /dt/d1/t.ibd /t.ibd
      root@c480fbb475db:/test# mysql d1 <<EOL
      > drop table t;
      > create table t(a varchar(5)) encrypted=yes encryption_key_id=1;
      > alter table t discard tablespace;
      > EOL
      root@c480fbb475db:/test# cp /t.ibd /dt/d1/
      root@c480fbb475db:/test# mysql -e "alter table d1.t import tablespace;"
      ERROR 1296 (HY000) at line 1: Got error 39 'Data structure corruption' from ./d1/t.ibd

      If I don't drop the table inbetween - it works.
      Attached mtr test case shows the same error:

      ALTER TABLE t1 IMPORT TABLESPACE;
      encryption.innodb-discard-import-adv 'cbc,innodb_plugin' [ fail ]
      Test ended at 2016-12-23 11:46:15

      CURRENT_TEST: encryption.innodb-discard-import-adv
      mysqltest: At line 134: query 'ALTER TABLE t1 IMPORT TABLESPACE' failed: 1296: Got error 39 'Data structure corruption' from ./test/t1.ibd

      Attachments

        Activity

          People

            jplindst Jan Lindström (Inactive)
            anikitin Andrii Nikitin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.