[MDEV-8130] Wrong error code/message while encrypting a partitioned InnoDB table Created: 2015-05-10  Updated: 2015-05-15  Resolved: 2015-05-12

Status: Closed
Project: MariaDB Server
Component/s: Encryption, Storage Engine - InnoDB, Storage Engine - XtraDB
Affects Version/s: 10.1.4
Fix Version/s: 10.1.5

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None


 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



 Comments   
Comment by Elena Stepanova [ 2015-05-12 ]

Not 100% sure, but I think I had it later with non-partitioned tables as well, while modifying options at runtime and altering tables.

Generated at Thu Feb 08 07:24:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.