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

innodb_encrypt_tables=ON does not show tables are encrypted when created without specification

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • None
    • N/A
    • Encryption
    • None

    Description

      Hey,

      On an instance where `innodb_encrypt_tables` is set to ON, tables are not encrypted when it is not specified:

      MariaDB [dba]> set wsrep_on=0;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [dba]> create table hello_test2 (id serial);
      Query OK, 0 rows affected (0.023 sec)
       
      MariaDB [dba]> show create table hello_test2\G
      *************************** 1. row ***************************
             Table: hello_test2
      Create Table: CREATE TABLE `hello_test2` (
        `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
        UNIQUE KEY `id` (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
      1 row in set (0.001 sec)
       
      MariaDB [dba]> show session variables like 'innodb_encrypt_tables';
      +-----------------------+-------+
      | Variable_name         | Value |
      +-----------------------+-------+
      | innodb_encrypt_tables | ON    |
      +-----------------------+-------+
      1 row in set (0.001 sec)
       
      MariaDB [dba]> create table hello_test3 (id serial) encrypted=yes;
      Query OK, 0 rows affected (0.080 sec)
       
      MariaDB [dba]> show create table hello_test3\G
      *************************** 1. row ***************************
             Table: hello_test3
      Create Table: CREATE TABLE `hello_test3` (
        `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
        UNIQUE KEY `id` (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `encrypted`=yes
      1 row in set (0.001 sec)
      

      Inspecting the table on the disk shows that both tables are actually encrypted.
      Executing ALTER TABLE hello_test2 ENCRYPTED=yes rebuilds the table while it is actually already encrypted.

      I would expect that the table shows up as encrypted=no if encryption is innodb_encrypt_tables is ON or FORCE.
      And, next to that, I would expect that a table is not rebuilt if it is already encrypted by default, and then encryption is explicitly added to it by ALTER TABLE ... encrypted=Yes;

      Thank you,
      Michael

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            michaeldg Michaël de groot
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.