mirror of
https://github.com/MariaDB/server.git
synced 2025-06-01 19:42:01 +03:00
When MariaDB 10.1.0 introduced table options for encryption and compression, it unnecessarily changed ha_innobase::check_if_supported_inplace_alter() so that ALGORITHM=COPY is forced when these parameters differ. A better solution is to move the check to innobase_need_rebuild(). In that way, the ALGORITHM=INPLACE interface (yes, the syntax is very misleading) can be used for rebuilding the table much more efficiently, with merge sort, with no undo logging, and allowing concurrent DML operations.
53 lines
2.5 KiB
Plaintext
53 lines
2.5 KiB
Plaintext
SET GLOBAL innodb_file_format = `Barracuda`;
|
|
SET GLOBAL innodb_file_per_table = ON;
|
|
SET GLOBAL innodb_encrypt_tables = ON;
|
|
SET GLOBAL innodb_encryption_threads = 4;
|
|
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO ENCRYPTION_KEY_ID=4;
|
|
Warnings:
|
|
Warning 140 InnoDB: Ignored ENCRYPTION_KEY_ID 4 when encryption is disabled
|
|
DROP TABLE t1;
|
|
set innodb_default_encryption_key_id = 99;
|
|
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB;
|
|
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
|
SHOW WARNINGS;
|
|
Level Code Message
|
|
Warning 140 InnoDB: ENCRYPTION_KEY_ID 99 not available
|
|
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
|
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
|
|
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES;
|
|
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
|
SHOW WARNINGS;
|
|
Level Code Message
|
|
Warning 140 InnoDB: ENCRYPTION_KEY_ID 99 not available
|
|
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
|
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
|
|
set innodb_default_encryption_key_id = 4;
|
|
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=YES;
|
|
SHOW CREATE TABLE t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`pk` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c` varchar(256) DEFAULT NULL,
|
|
PRIMARY KEY (`pk`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `ENCRYPTED`=YES `ENCRYPTION_KEY_ID`=4
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB;
|
|
SHOW CREATE TABLE t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`pk` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c` varchar(256) DEFAULT NULL,
|
|
PRIMARY KEY (`pk`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `ENCRYPTION_KEY_ID`=4
|
|
CREATE TABLE t2 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO ENCRYPTION_KEY_ID=1;
|
|
Warnings:
|
|
Warning 140 InnoDB: Ignored ENCRYPTION_KEY_ID 1 when encryption is disabled
|
|
ALTER TABLE t1 ENCRYPTION_KEY_ID=99;
|
|
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID'
|
|
SHOW WARNINGS;
|
|
Level Code Message
|
|
Warning 140 InnoDB: ENCRYPTION_KEY_ID 99 not available
|
|
Error 1478 Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID'
|
|
set innodb_default_encryption_key_id = 1;
|
|
drop table t1,t2;
|