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

Wrong error code/message while encrypting a partitioned InnoDB table

    XMLWordPrintable

Details

    Description

      I start server with

      plugin-load-add=file_key_management.so 
      file_key_management_filename=/home/elenst/git/10.1/mysql-test/std_data/keys.txt 
      innodb-encrypt-tables=FORCE

      This is expected:

      MariaDB [test]> create table t1 (i int) engine=InnoDB;
      Query OK, 0 rows affected (0.52 sec)
       
      MariaDB [test]> alter table t1 encrypted=NO;
      ERROR 1005 (HY000): Can't create table `test`.`#sql-5524_3` (errno: 140 "Wrong create options")
      MariaDB [test]> alter table t1 encrypted=YES;
      Query OK, 0 rows affected (1.05 sec)               
      Records: 0  Duplicates: 0  Warnings: 0

      This is not expected:

      MariaDB [test]> create table t2 (i int) partition by hash(i) partitions 2;
      Query OK, 0 rows affected (1.09 sec)
       
      MariaDB [test]> alter table t2 encrypted=NO;
      ERROR 1478 (HY000): Table storage engine 'InnoDB' does not support the create option 'ENCRYPTED'

      I would think that encryption is just not available for partitioned tables, but then the following does not make sense:

      MariaDB [test]> alter table t2 encrypted=YES;
      Query OK, 0 rows affected (1.71 sec)
      Records: 0  Duplicates: 0  Warnings: 0

      So, I assume ERROR 1478 is just a wrong error code, there should be ERROR 1005 instead, as it was for a non-partitioned table?

      MariaDB [test]> show variables like '%encrypt%';
      +------------------------------------------+---------+
      | Variable_name                            | Value   |
      +------------------------------------------+---------+
      | aria_encrypt_tables                      | OFF     |
      | encrypt_tmp_disk_tables                  | OFF     |
      | file_key_management_encryption_algorithm | aes_cbc |
      | innodb_default_encryption_key_id         | 1       |
      | innodb_encrypt_log                       | OFF     |
      | innodb_encrypt_tables                    | FORCE   |
      | innodb_encryption_rotate_key_age         | 1       |
      | innodb_encryption_rotation_iops          | 100     |
      | innodb_encryption_threads                | 0       |
      +------------------------------------------+---------+
      9 rows in set (0.01 sec)

      10.1 commit 5fdb14542ae44aa2f0bae512e8305f791c977ca1

      Attachments

        Activity

          People

            serg Sergei Golubchik
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.