Commit d7d589dc authored by Monty's avatar Monty Committed by Sergei Golubchik

Push for testing of encryption

parent 3a3ec744
...@@ -268,6 +268,8 @@ extern my_bool maria_delay_key_write; ...@@ -268,6 +268,8 @@ extern my_bool maria_delay_key_write;
extern my_off_t maria_max_temp_length; extern my_off_t maria_max_temp_length;
extern ulong maria_bulk_insert_tree_size, maria_data_pointer_size; extern ulong maria_bulk_insert_tree_size, maria_data_pointer_size;
extern MY_TMPDIR *maria_tmpdir; extern MY_TMPDIR *maria_tmpdir;
extern my_bool maria_encrypt_tables;
/* /*
This is used to check if a symlink points into the mysql data home, This is used to check if a symlink points into the mysql data home,
which is normally forbidden as it can be used to get access to which is normally forbidden as it can be used to get access to
......
#ifndef MY_AES_INCLUDED
#define MY_AES_INCLUDED
/* Copyright (c) 2002, 2006 MySQL AB, 2009 Sun Microsystems, Inc. /* Copyright (c) 2002, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
Use is subject to license terms. Use is subject to license terms.
...@@ -21,47 +18,192 @@ ...@@ -21,47 +18,192 @@
/* Header file for my_aes.c */ /* Header file for my_aes.c */
/* Wrapper to give simple interface for MySQL to AES standard encryption */ /* Wrapper to give simple interface for MySQL to AES standard encryption */
#ifndef MY_AES_INCLUDED
#define MY_AES_INCLUDED
/* We expect same result code from encryption functions as in my_aes.h */
typedef int Crypt_result;
#define AES_OK 0
#define AES_BAD_DATA -1
#define AES_BAD_IV -2
#define AES_INVALID -3
#define AES_OPENSSL_ERROR -4
#define AES_BAD_KEYSIZE -5
#define AES_KEY_CREATION_FAILED -10
#define CRYPT_KEY_OK 0
#define CRYPT_BUFFER_TO_SMALL -11;
#define CRYPT_KEY_UNKNOWN -48;
/* The max block sizes of all supported algorithms */
#define MY_AES_BLOCK_SIZE 16
/* The max key length of all supported algorithms */
#define MY_AES_MAX_KEY_LENGTH 32
#include "rijndael.h" #include "rijndael.h"
C_MODE_START C_MODE_START
#define AES_KEY_LENGTH 128 /* Must be 128 192 or 256 */ #define AES_KEY_LENGTH 128 /* Must be 128 192 or 256 */
/* /**
my_aes_encrypt - Crypt buffer with AES encryption algorithm. Crypt buffer with AES dynamic (defined at startup) encryption algorithm.
source - Pointer to data for encryption
source_length - size of encryption data SYNOPSIS
dest - buffer to place encrypted data (must be large enough) my_aes_encrypt_dynamic()
key - Key to be used for encryption @param source [in] Pointer to data for encryption
kel_length - Length of the key. Will handle keys of any length @param source_length [in] Size of encryption data
@param dest [out] Buffer to place encrypted data (must be large enough)
@param dest_length [out] Pointer to size of encrypted data
@param key [in] Key to be used for encryption
@param key_length [in] Length of the key. 16, 24 or 32
@param iv [in] Iv to be used for encryption
@param iv_length [in] Length of the iv. should be 16.
@param noPadding [in] if set, algorithm specific padding behaviour is used
Method used defined by calling my_aes_init_dynamic_encrypt() at startup.
@return
!= 0 error
0 no error
*/
typedef int (*my_aes_encrypt_dynamic_type)(const uchar* source, uint32 source_length,
uchar* dest, uint32* dest_length,
const uchar* key, uint8 key_length,
const uchar* iv, uint8 iv_length,
uint noPadding);
extern my_aes_encrypt_dynamic_type my_aes_encrypt_dynamic;
/**
AES decryption AES dynamic (defined at startup) encryption algorithm.
SYNOPSIS
my_aes_decrypt_dynamic()
@param source [in] Pointer to data to decrypt
@param source_length [in] Size of data
@param dest [out] Buffer to place decrypted data (must be large enough)
@param dest_length [out] Pointer to size of decrypted data
@param key [in] Key to be used for decryption
@param key_length [in] Length of the key. 16, 24 or 32
@param iv [in] Iv to be used for encryption
@param iv_length [in] Length of the iv. should be 16.
@param noPadding [in] if set, algorithm specific padding behaviour is used
@return
!= 0 error
0 no error
Method used defined by calling my_aes_init_dynamic_encrypt() at startup.
*/
typedef int (*my_aes_decrypt_dynamic_type)(const uchar *source,
uint32 source_length,
uchar *dest, uint32 *dest_length,
const uchar *key, uint8 key_length,
const uchar *iv, uint8 iv_length,
uint noPadding);
extern my_aes_decrypt_dynamic_type my_aes_decrypt_dynamic;
/**
Initialize dynamic crypt functions
*/
enum enum_my_aes_encryption_algorithm
{
MY_AES_ALGORITHM_NONE, MY_AES_ALGORITHM_ECB, MY_AES_ALGORITHM_CBC,
MY_AES_ALGORITHM_CTR
};
returns - size of encrypted data, or negative in case of error. my_aes_decrypt_dynamic_type get_aes_decrypt_func(enum enum_my_aes_encryption_algorithm method);
my_aes_encrypt_dynamic_type get_aes_encrypt_func(enum enum_my_aes_encryption_algorithm method);
my_bool my_aes_init_dynamic_encrypt(enum enum_my_aes_encryption_algorithm method);
extern MYSQL_PLUGIN_IMPORT enum enum_my_aes_encryption_algorithm current_aes_dynamic_method;
/**
Calculate key and iv from a given salt and secret as it is handled in openssl
encrypted files via console
SYNOPSIS
my_bytes_to_key()
@param salt [in] the given salt as extracted from the encrypted file
@param secret [in] the given secret as String, provided by the user
@param key [out] 32 Bytes of key are written to this pointer
@param iv [out] 16 Bytes of iv are written to this pointer
*/
void my_bytes_to_key(const uchar *salt,
const char *secret, uchar *key,
uchar *iv);
/**
Decode Hexencoded String to uint8[].
SYNOPSIS
my_aes_hex2uint()
@param iv [in] Pointer to hexadecimal encoded IV String
@param dest [out] Pointer to output uint8 array. Memory needs to be
allocated by caller
@param iv_length [in] Size of destination array.
*/
void my_aes_hex2uint(const char *in, uchar *out, int dest_length);
/**
Crypt buffer with AES encryption algorithm.
SYNOPSIS
my_aes_encrypt()
@param source Pointer to data for encryption
@param source_length Size of encryption data
@param dest Buffer to place encrypted data (must be large enough)
@param key Key to be used for encryption
@param kel_length Length of the key. Will handle keys of any length
@return Size of encrypted data, or negative in case of error.
*/ */
int my_aes_encrypt(const char *source, int source_length, char *dest, int my_aes_encrypt(const uchar *source, int source_length, uchar *dest,
const char *key, int key_length); const char *key, int key_length);
/* /**
my_aes_decrypt - DeCrypt buffer with AES encryption algorithm. DeCrypt buffer with AES encryption algorithm.
source - Pointer to data for decryption
source_length - size of encrypted data SYNOPSIS
dest - buffer to place decrypted data (must be large enough) my_aes_decrypt()
key - Key to be used for decryption
kel_length - Length of the key. Will handle keys of any length
returns - size of original data, or negative in case of error. @param source Pointer to data for decryption
@param source_length size of encrypted data
@param dest buffer to place decrypted data (must be large enough)
@param key Key to be used for decryption
@param kel_length Length of the key. Will handle keys of any length
@return size of original data, or negative in case of error.
*/ */
int my_aes_decrypt(const char *source, int source_length, char *dest, int my_aes_decrypt(const uchar *source, int source_length, uchar *dest,
const char *key, int key_length); const char *key, int key_length);
/* /**
my_aes_get_size - get size of buffer which will be large enough for encrypted get size of buffer which will be large enough for encrypted data
data
source_length - length of data to be encrypted SYNOPSIS
my_aes_get_size()
@param source_length Length of data to be encrypted
returns - size of buffer required to store encrypted data @return Size of buffer required to store encrypted data
*/ */
int my_aes_get_size(int source_length); int my_aes_get_size(int source_length);
......
...@@ -354,6 +354,8 @@ enum ha_base_keytype { ...@@ -354,6 +354,8 @@ enum ha_base_keytype {
#define HA_CREATE_DELAY_KEY_WRITE 64 #define HA_CREATE_DELAY_KEY_WRITE 64
#define HA_CREATE_RELIES_ON_SQL_LAYER 128 #define HA_CREATE_RELIES_ON_SQL_LAYER 128
#define HA_CREATE_INTERNAL_TABLE 256 #define HA_CREATE_INTERNAL_TABLE 256
#define HA_CREATE_ENCRYPTED 512
#define HA_INSERT_ORDER 1024
/* Flags used by start_bulk_insert */ /* Flags used by start_bulk_insert */
......
// TODO: Add Windows support
#ifndef MYSYS_MY_CRYPT_H_
#define MYSYS_MY_CRYPT_H_
#include <my_aes.h>
#if !defined(HAVE_YASSL) && defined(HAVE_OPENSSL)
#define HAVE_EncryptAes128Ctr
C_MODE_START
Crypt_result my_aes_encrypt_ctr(const uchar* source, uint32 source_length,
uchar* dest, uint32* dest_length,
const unsigned char* key, uint8 key_length,
const unsigned char* iv, uint8 iv_length,
uint noPadding);
Crypt_result my_aes_decrypt_ctr(const uchar* source, uint32 source_length,
uchar* dest, uint32* dest_length,
const unsigned char* key, uint8 key_length,
const unsigned char* iv, uint8 iv_length,
uint noPadding);
C_MODE_END
Crypt_result EncryptAes128Ctr(const uchar* key,
const uchar* iv, int iv_size,
const uchar* plaintext, int plaintext_size,
uchar* ciphertext, int* ciphertext_used);
Crypt_result DecryptAes128Ctr(const uchar* key,
const uchar* iv, int iv_size,
const uchar* ciphertext, int ciphertext_size,
uchar* plaintext, int* plaintext_used);
#endif /* !defined(HAVE_YASSL) && defined(HAVE_OPENSSL) */
C_MODE_START
Crypt_result my_random_bytes(uchar* buf, int num);
C_MODE_END
#endif /* MYSYS_MY_CRYPT_H_ */
#ifndef MYSYS_MY_CRYPT_KEY_MANAGMENT_H_
#define MYSYS_MY_CRYPT_KEY_MANAGMENT_H_
#include "my_global.h"
#include "my_pthread.h"
#include "mysql/psi/psi.h"
#ifndef DBUG_OFF
extern my_bool debug_use_static_encryption_keys;
#ifdef HAVE_PSI_INTERFACE
extern PSI_rwlock_key key_LOCK_dbug_encryption_key_version;
#endif
extern mysql_rwlock_t LOCK_dbug_encryption_key_version;
extern uint opt_debug_encryption_key_version;
#endif /* DBUG_OFF */
C_MODE_START
/**
* function returning latest key version
*/
typedef int (* GetLatestCryptoKeyVersionFunc_t)();
/**
* function returning if the key exists
*/
typedef unsigned int (* HasKeyVersionFunc_t)(unsigned int version);
/**
* function returning the key size
*/
typedef int (* GetKeySizeFunc_t)(unsigned int version);
/**
* function returning a key for a key version
*/
typedef int (* GetCryptoKeyFunc_t)(unsigned int version,
unsigned char* key,
unsigned keybufsize);
/**
* function returning an iv for a key version
*/
typedef int (* GetCryptoIVFunc_t)(unsigned int version,
unsigned char* iv,
unsigned ivbufsize);
struct CryptoKeyFuncs_t
{
GetLatestCryptoKeyVersionFunc_t getLatestCryptoKeyVersionFunc;
HasKeyVersionFunc_t hasCryptoKeyFunc;
GetKeySizeFunc_t getCryptoKeySize;
GetCryptoKeyFunc_t getCryptoKeyFunc;
GetCryptoIVFunc_t getCryptoIVFunc;
};
/**
* Install functions to use for key management
*/
void
InstallCryptoKeyFunctions(const struct CryptoKeyFuncs_t* cryptoKeyFuncs);
/**
* Functions to interact with key management
*/
int GetLatestCryptoKeyVersion();
unsigned int HasCryptoKey(unsigned int version);
int GetCryptoKeySize(unsigned int version);
int GetCryptoKey(unsigned int version, unsigned char* key_buffer,
unsigned int size);
int GetCryptoIV(unsigned int version, unsigned char* key_buffer,
unsigned int size);
C_MODE_END
#endif // MYSYS_MY_CRYPT_KEY_MANAGMENT_H_
...@@ -176,6 +176,9 @@ extern void _db_suicide_(); ...@@ -176,6 +176,9 @@ extern void _db_suicide_();
#define DBUG_SYNC_POINT(lock_name,lock_timeout) \ #define DBUG_SYNC_POINT(lock_name,lock_timeout) \
debug_sync_point(lock_name,lock_timeout) debug_sync_point(lock_name,lock_timeout)
void debug_sync_point(const char* lock_name, uint lock_timeout); void debug_sync_point(const char* lock_name, uint lock_timeout);
/* Extern function for debugging */
extern void dump_buffer(FILE *stream, unsigned n, const unsigned char* buf);
#else #else
#define DBUG_SYNC_POINT(lock_name,lock_timeout) #define DBUG_SYNC_POINT(lock_name,lock_timeout)
#endif /* EXTRA_DEBUG */ #endif /* EXTRA_DEBUG */
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
extern "C" { extern "C" {
#endif #endif
#define compute_md5_hash(A,B,C) my_md5(A,B,C) #define compute_md5_hash(A,B,C) my_md5((unsigned char *)A,B,C)
/* /*
Convert an array of bytes to a hexadecimal representation. Convert an array of bytes to a hexadecimal representation.
......
...@@ -88,7 +88,8 @@ typedef struct st_mysql_xid MYSQL_XID; ...@@ -88,7 +88,8 @@ typedef struct st_mysql_xid MYSQL_XID;
#define MYSQL_AUDIT_PLUGIN 5 #define MYSQL_AUDIT_PLUGIN 5
#define MYSQL_REPLICATION_PLUGIN 6 #define MYSQL_REPLICATION_PLUGIN 6
#define MYSQL_AUTHENTICATION_PLUGIN 7 #define MYSQL_AUTHENTICATION_PLUGIN 7
#define MYSQL_MAX_PLUGIN_TYPE_NUM 9 /* The number of plugin types */ #define MYSQL_KEY_MANAGEMENT_PLUGIN 9
#define MYSQL_MAX_PLUGIN_TYPE_NUM 10 /* The number of plugin types */
/* MariaDB plugin types */ /* MariaDB plugin types */
#define MariaDB_PASSWORD_VALIDATION_PLUGIN 8 #define MariaDB_PASSWORD_VALIDATION_PLUGIN 8
......
...@@ -26,7 +26,6 @@ ${PCRE_INCLUDES} ...@@ -26,7 +26,6 @@ ${PCRE_INCLUDES}
${ZLIB_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR}
${SSL_INCLUDE_DIRS} ${SSL_INCLUDE_DIRS}
${SSL_INTERNAL_INCLUDE_DIRS} ${SSL_INTERNAL_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/sql/backup
) )
SET(GEN_SOURCES SET(GEN_SOURCES
......
#
# Ensure we have innodb encryption incompiled
if (`select count(*)=0 from information_schema.global_variables where variable_name="innodb_data_encryption_providertype"`)
{
--skip Test requires InnoDB encryption.
}
...@@ -78,6 +78,8 @@ let $mms_purpose=comparison; ...@@ -78,6 +78,8 @@ let $mms_purpose=comparison;
let $mms_compare_physically=$mms_compare_physically_save; let $mms_compare_physically=$mms_compare_physically_save;
while ($mms_table_to_use) while ($mms_table_to_use)
{ {
# the size of the index file is different for with/without encryption
--replace_result 372 <SIZE> 394 <SIZE>
eval check table $mms_tname$mms_table_to_use extended; eval check table $mms_tname$mms_table_to_use extended;
--echo * testing that checksum after recovery is as expected --echo * testing that checksum after recovery is as expected
let $new_checksum=`CHECKSUM TABLE $mms_tname$mms_table_to_use`; let $new_checksum=`CHECKSUM TABLE $mms_tname$mms_table_to_use`;
......
if (`select @@innodb_encrypt_tables = 1`)
{
skip only without encryption;
}
...@@ -19,7 +19,14 @@ if ($rpl_inited) ...@@ -19,7 +19,14 @@ if ($rpl_inited)
shutdown_server 60; shutdown_server 60;
# Write file to make mysql-test-run.pl start up the server again # Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $_expect_file_name if ($restart_parameters)
{
--exec echo "restart: $restart_parameters" > $_expect_file_name
}
if (!$restart_parameters)
{
--exec echo "restart" > $_expect_file_name
}
# Turn on reconnect # Turn on reconnect
--enable_reconnect --enable_reconnect
......
...@@ -31,6 +31,8 @@ INNODB_SYS_FOREIGN_COLS ...@@ -31,6 +31,8 @@ INNODB_SYS_FOREIGN_COLS
INNODB_SYS_INDEXES INNODB_SYS_INDEXES
INNODB_SYS_TABLES INNODB_SYS_TABLES
INNODB_SYS_TABLESTATS INNODB_SYS_TABLESTATS
INNODB_TABLESPACES_ENCRYPTION
INNODB_TABLESPACES_SCRUBBING
INNODB_TRX INNODB_TRX
KEY_CACHES KEY_CACHES
KEY_COLUMN_USAGE KEY_COLUMN_USAGE
...@@ -102,6 +104,8 @@ INNODB_SYS_FOREIGN_COLS ID ...@@ -102,6 +104,8 @@ INNODB_SYS_FOREIGN_COLS ID
INNODB_SYS_INDEXES INDEX_ID INNODB_SYS_INDEXES INDEX_ID
INNODB_SYS_TABLES TABLE_ID INNODB_SYS_TABLES TABLE_ID
INNODB_SYS_TABLESTATS TABLE_ID INNODB_SYS_TABLESTATS TABLE_ID
INNODB_TABLESPACES_ENCRYPTION SPACE
INNODB_TABLESPACES_SCRUBBING SPACE
INNODB_TRX trx_id INNODB_TRX trx_id
KEY_CACHES KEY_CACHE_NAME KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
...@@ -173,6 +177,8 @@ INNODB_SYS_FOREIGN_COLS ID ...@@ -173,6 +177,8 @@ INNODB_SYS_FOREIGN_COLS ID
INNODB_SYS_INDEXES INDEX_ID INNODB_SYS_INDEXES INDEX_ID
INNODB_SYS_TABLES TABLE_ID INNODB_SYS_TABLES TABLE_ID
INNODB_SYS_TABLESTATS TABLE_ID INNODB_SYS_TABLESTATS TABLE_ID
INNODB_TABLESPACES_ENCRYPTION SPACE
INNODB_TABLESPACES_SCRUBBING SPACE
INNODB_TRX trx_id INNODB_TRX trx_id
KEY_CACHES KEY_CACHE_NAME KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
...@@ -249,6 +255,8 @@ INNODB_SYS_FOREIGN_COLS information_schema.INNODB_SYS_FOREIGN_COLS 1 ...@@ -249,6 +255,8 @@ INNODB_SYS_FOREIGN_COLS information_schema.INNODB_SYS_FOREIGN_COLS 1
INNODB_SYS_INDEXES information_schema.INNODB_SYS_INDEXES 1 INNODB_SYS_INDEXES information_schema.INNODB_SYS_INDEXES 1
INNODB_SYS_TABLES information_schema.INNODB_SYS_TABLES 1 INNODB_SYS_TABLES information_schema.INNODB_SYS_TABLES 1
INNODB_SYS_TABLESTATS information_schema.INNODB_SYS_TABLESTATS 1 INNODB_SYS_TABLESTATS information_schema.INNODB_SYS_TABLESTATS 1
INNODB_TABLESPACES_ENCRYPTION information_schema.INNODB_TABLESPACES_ENCRYPTION 1
INNODB_TABLESPACES_SCRUBBING information_schema.INNODB_TABLESPACES_SCRUBBING 1
INNODB_TRX information_schema.INNODB_TRX 1 INNODB_TRX information_schema.INNODB_TRX 1
KEY_CACHES information_schema.KEY_CACHES 1 KEY_CACHES information_schema.KEY_CACHES 1
KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1 KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
...@@ -310,6 +318,8 @@ Database: information_schema ...@@ -310,6 +318,8 @@ Database: information_schema
| INNODB_SYS_INDEXES | | INNODB_SYS_INDEXES |
| INNODB_SYS_TABLES | | INNODB_SYS_TABLES |
| INNODB_SYS_TABLESTATS | | INNODB_SYS_TABLESTATS |
| INNODB_TABLESPACES_ENCRYPTION |
| INNODB_TABLESPACES_SCRUBBING |
| INNODB_TRX | | INNODB_TRX |
| KEY_CACHES | | KEY_CACHES |
| KEY_COLUMN_USAGE | | KEY_COLUMN_USAGE |
...@@ -371,6 +381,8 @@ Database: INFORMATION_SCHEMA ...@@ -371,6 +381,8 @@ Database: INFORMATION_SCHEMA
| INNODB_SYS_INDEXES | | INNODB_SYS_INDEXES |
| INNODB_SYS_TABLES | | INNODB_SYS_TABLES |
| INNODB_SYS_TABLESTATS | | INNODB_SYS_TABLESTATS |
| INNODB_TABLESPACES_ENCRYPTION |
| INNODB_TABLESPACES_SCRUBBING |
| INNODB_TRX | | INNODB_TRX |
| KEY_CACHES | | KEY_CACHES |
| KEY_COLUMN_USAGE | | KEY_COLUMN_USAGE |
...@@ -405,5 +417,5 @@ Wildcard: inf_rmation_schema ...@@ -405,5 +417,5 @@ Wildcard: inf_rmation_schema
| information_schema | | information_schema |
SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') GROUP BY TABLE_SCHEMA; SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') GROUP BY TABLE_SCHEMA;
table_schema count(*) table_schema count(*)
information_schema 56 information_schema 59
mysql 30 mysql 30
...@@ -162,6 +162,13 @@ The following options may be given as the first argument: ...@@ -162,6 +162,13 @@ The following options may be given as the first argument:
--div-precision-increment=# --div-precision-increment=#
Precision of the result of '/' operator will be increased Precision of the result of '/' operator will be increased
on that value on that value
--encrypt-tmp-disk-tables
Encrypt tmp disk tables (created as part of query
execution)
--encryption-algorithm=name
Which encryption algorithm to use for table encryption.
aes_cbc is the recommended one.. One of: none, aes_ecb,
aes_cbc, aes_ctr
--event-scheduler[=name] --event-scheduler[=name]
Enable the event scheduler. Possible values are ON, OFF, Enable the event scheduler. Possible values are ON, OFF,
and DISABLED (keep the event scheduler completely and DISABLED (keep the event scheduler completely
...@@ -1141,6 +1148,8 @@ delayed-insert-limit 100 ...@@ -1141,6 +1148,8 @@ delayed-insert-limit 100
delayed-insert-timeout 300 delayed-insert-timeout 300
delayed-queue-size 1000 delayed-queue-size 1000
div-precision-increment 4 div-precision-increment 4
encrypt-tmp-disk-tables FALSE
encryption-algorithm none
event-scheduler OFF event-scheduler OFF
expensive-subquery-limit 100 expensive-subquery-limit 100
expire-logs-days 0 expire-logs-days 0
......
...@@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines ...@@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines
WHERE ENGINE = 'InnoDB'; WHERE ENGINE = 'InnoDB';
ENGINE InnoDB ENGINE InnoDB
SUPPORT YES SUPPORT YES
COMMENT Supports transactions, row-level locking, and foreign keys COMMENT Supports transactions, row-level locking, foreign keys and encryption for tables
TRANSACTIONS YES TRANSACTIONS YES
XA YES XA YES
SAVEPOINTS YES SAVEPOINTS YES
1;F5502320F8429037B8DAEF761B189D12;770A8A65DA156D24EE2A093277530142
2;35B2FF0795FB84BBD666DB8430CA214E;4D92199549E0F2EF009B4160F3582E5528A11A45017F3EF8
3;7E892875A52C59A3B588306B13C31FBD;B374A26A71490437AA024E4FADD5B497FDFF1A8EA6FF12F6FB65AF2720B59CCF
4;021B0663D4DD7B54E2EBC852677E40BD;18420B5CBA31CCDFFE9716E91EB61374D05914F3ADE23E03
5;9BF92CEA026CE732DA80821122A8CE97;966050D7777350B6FD5CCB3E5F648DA45C63BEFB6DEDDFA13443F156B7D35C84
6;BC44D4AFD2D9FCD82A679E4DC6700D06;B5EA210C8C09EF20DB95EC584714A89F
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact page_encryption=1 page_encryption_key=1;
create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed page_encryption=1 page_encryption_key=2;
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_encryption=1 page_encryption_key=3;
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant page_encryption=1 page_encryption_key=4;
show create table innodb_compact;
Table Create Table
innodb_compact CREATE TABLE `innodb_compact` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `page_encryption`=1 `page_encryption_key`=1
show create table innodb_compressed;
Table Create Table
innodb_compressed CREATE TABLE `innodb_compressed` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `page_encryption`=1 `page_encryption_key`=2
show create table innodb_dynamic;
Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `page_encryption`=1 `page_encryption_key`=3
show create table innodb_redundant;
Table Create Table
innodb_redundant CREATE TABLE `innodb_redundant` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT `page_encryption`=1 `page_encryption_key`=4
create procedure innodb_insert_proc (repeat_count int)
begin
declare current_num int;
set current_num = 0;
while current_num < repeat_count do
insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
set current_num = current_num + 1;
end while;
end//
commit;
set autocommit=0;
call innodb_insert_proc(5000);
commit;
set autocommit=1;
insert into innodb_compact select * from innodb_normal;
insert into innodb_compressed select * from innodb_normal;
insert into innodb_dynamic select * from innodb_normal;
insert into innodb_redundant select * from innodb_normal;
update innodb_compact set c1 = c1 + 1;
update innodb_compressed set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
update innodb_redundant set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000;
count(*)
5000
select count(*) from innodb_compressed where c1 < 1500000;
count(*)
5000
select count(*) from innodb_dynamic where c1 < 1500000;
count(*)
5000
select count(*) from innodb_redundant where c1 < 1500000;
count(*)
5000
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encrypted';
variable_value >= 0
1
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decrypted';
variable_value >= 0
1
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encryption_error';
variable_value = 0
1
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
update innodb_compact set c1 = c1 + 1;
update innodb_compressed set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
update innodb_redundant set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000;
count(*)
5000
select count(*) from innodb_compressed where c1 < 1500000;
count(*)
5000
select count(*) from innodb_dynamic where c1 < 1500000;
count(*)
5000
select count(*) from innodb_redundant where c1 < 1500000;
count(*)
5000
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encrypted';
variable_value >= 0
1
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decrypted';
variable_value >= 0
1
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encryption_error';
variable_value = 0
1
alter table innodb_compact engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT;
show create table innodb_compact;
Table Create Table
innodb_compact CREATE TABLE `innodb_compact` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
alter table innodb_compressed engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT;
show create table innodb_compressed;
Table Create Table
innodb_compressed CREATE TABLE `innodb_compressed` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
alter table innodb_dynamic engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT;
show create table innodb_dynamic;
Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
alter table innodb_redundant engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT;
show create table innodb_redundant;
Table Create Table
innodb_redundant CREATE TABLE `innodb_redundant` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
show create table innodb_compact;
Table Create Table
innodb_compact CREATE TABLE `innodb_compact` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
show create table innodb_compressed;
Table Create Table
innodb_compressed CREATE TABLE `innodb_compressed` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
show create table innodb_dynamic;
Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
show create table innodb_redundant;
Table Create Table
innodb_redundant CREATE TABLE `innodb_redundant` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
update innodb_compact set c1 = c1 + 1;
update innodb_compressed set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
update innodb_redundant set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000;
count(*)
5000
select count(*) from innodb_compressed where c1 < 1500000;
count(*)
5000
select count(*) from innodb_dynamic where c1 < 1500000;
count(*)
5000
select count(*) from innodb_redundant where c1 < 1500000;
count(*)
5000
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encrypted';
variable_value = 0
1
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decrypted';
variable_value = 0
1
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encryption_error';
variable_value = 0
1
drop procedure innodb_insert_proc;
drop table innodb_normal;
drop table innodb_compact;
drop table innodb_compressed;
drop table innodb_dynamic;
drop table innodb_redundant;
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb page_compressed=1;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact page_encryption=1 page_encryption_key=1 page_compressed=1;
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_encryption=1 page_encryption_key=2 page_compressed=1;
show warnings;
Level Code Message
show create table innodb_normal;
Table Create Table
innodb_normal CREATE TABLE `innodb_normal` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1
show create table innodb_compact;
Table Create Table
innodb_compact CREATE TABLE `innodb_compact` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `page_encryption`=1 `page_encryption_key`=1 `page_compressed`=1
show create table innodb_dynamic;
Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `page_encryption`=1 `page_encryption_key`=2 `page_compressed`=1
create procedure innodb_insert_proc (repeat_count int)
begin
declare current_num int;
set current_num = 0;
while current_num < repeat_count do
insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
set current_num = current_num + 1;
end while;
end//
commit;
set autocommit=0;
call innodb_insert_proc(5000);
commit;
set autocommit=1;
insert into innodb_compact select * from innodb_normal;
insert into innodb_dynamic select * from innodb_normal;
update innodb_normal set c1 = c1 + 1;
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
select count(*) from innodb_normal;
count(*)
5000
select count(*) from innodb_compact where c1 < 1500000;
count(*)
5000
select count(*) from innodb_dynamic where c1 < 1500000;
count(*)
5000
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encrypted';
variable_value >= 0
1
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decrypted';
variable_value >= 0
1
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encryption_error';
variable_value = 0
1
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_compressed';
variable_value >= 0
1
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed';
variable_value >= 0
1
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1;
update innodb_normal set c1 = c1 + 1;
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
select count(*) from innodb_normal;
count(*)
5000
select count(*) from innodb_compact where c1 < 1500000;
count(*)
5000
select count(*) from innodb_dynamic where c1 < 1500000;
count(*)
5000
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encrypted';
variable_value >= 0
1
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decrypted';
variable_value >= 0
1
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encryption_error';
variable_value = 0
1
SELECT variable_value > 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_compressed';
variable_value > 0
0
SELECT variable_value > 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed';
variable_value > 0
1
alter table innodb_normal engine=innodb page_compressed=DEFAULT;
show create table innodb_normal;
Table Create Table
innodb_normal CREATE TABLE `innodb_normal` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
alter table innodb_compact engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT page_compressed=DEFAULT;
show create table innodb_compact;
Table Create Table
innodb_compact CREATE TABLE `innodb_compact` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
alter table innodb_dynamic engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT page_compressed=DEFAULT;
show create table innodb_dynamic;
Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
show create table innodb_normal;
Table Create Table
innodb_normal CREATE TABLE `innodb_normal` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
show create table innodb_compact;
Table Create Table
innodb_compact CREATE TABLE `innodb_compact` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
show create table innodb_dynamic;
Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
update innodb_normal set c1 = c1 + 1;
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
select count(*) from innodb_normal;
count(*)
5000
select count(*) from innodb_compact where c1 < 1500000;
count(*)
5000
select count(*) from innodb_dynamic where c1 < 1500000;
count(*)
5000
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encrypted';
variable_value = 0
1
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decrypted';
variable_value = 0
1
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encryption_error';
variable_value = 0
1
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_compressed';
variable_value = 0
1
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed';
variable_value = 0
1
drop procedure innodb_insert_proc;
drop table innodb_normal;
drop table innodb_compact;
drop table innodb_dynamic;
SET @start_global_value = @@global.innodb_encryption_threads;
SHOW VARIABLES LIKE 'innodb_encrypt%';
Variable_name Value
innodb_encrypt_log OFF
innodb_encrypt_tables ON
innodb_encryption_rotate_key_age 15
innodb_encryption_rotation_iops 100
innodb_encryption_threads 4
DESCRIBE INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
Field Type Null Key Default Extra
SPACE int(11) unsigned NO 0
NAME varchar(655) YES NULL
ENCRYPTION_SCHEME int(11) unsigned NO 0
KEYSERVER_REQUESTS int(11) unsigned NO 0
MIN_KEY_VERSION int(11) unsigned NO 0
CURRENT_KEY_VERSION int(11) unsigned NO 0
KEY_ROTATION_PAGE_NUMBER bigint(21) unsigned YES NULL
KEY_ROTATION_MAX_PAGE_NUMBER bigint(21) unsigned YES NULL
# Wait max 5 min for key encryption threads to encrypt one space
# Success!
# Wait max 10 min for key encryption threads to encrypt all space
# Success!
# Now turn off encryption and wait for threads to decrypt everything
SET GLOBAL innodb_encrypt_tables = off;
# Wait max 10 min for key encryption threads to decrypt all space
# Success!
# Shutdown innodb_encryption_threads
SET GLOBAL innodb_encryption_threads=0;
# Turn on encryption
# since threads are off tables should remain unencrypted
SET GLOBAL innodb_encrypt_tables = on;
# Wait 15s to check that nothing gets encrypted
# Success!
# Startup innodb_encryption_threads
SET GLOBAL innodb_encryption_threads=@start_global_value;
# Wait 1 min to check that it start encrypting again
# Success!
#
# Check that restart with encryption turned off works
# even if spaces are encrypted
#
# First wait max 10 min for key encryption threads to encrypt all spaces
# Success!
# Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
SHOW VARIABLES LIKE 'innodb_encrypt%';
Variable_name Value
innodb_encrypt_log OFF
innodb_encrypt_tables OFF
innodb_encryption_rotate_key_age 15
innodb_encryption_rotation_iops 100
innodb_encryption_threads 0
SELECT COUNT(*) > 0 as should_be_1
FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
WHERE MIN_KEY_VERSION <> 0;
should_be_1
1
# Restart mysqld again...with default options
...@@ -180,6 +180,9 @@ compress_page_compressed_trim_op disabled ...@@ -180,6 +180,9 @@ compress_page_compressed_trim_op disabled
compress_page_compressed_trim_op_saved disabled compress_page_compressed_trim_op_saved disabled
compress_pages_page_decompressed disabled compress_pages_page_decompressed disabled
compress_pages_page_compression_error disabled compress_pages_page_compression_error disabled
compress_pages_page_encrypted disabled
compress_pages_page_decrypted disabled
compress_pages_page_encryption_error disabled
index_page_splits disabled index_page_splits disabled
index_page_merge_attempts disabled index_page_merge_attempts disabled
index_page_merge_successful disabled index_page_merge_successful disabled
......
create table snapshot_status engine = myisam
select * from information_schema.global_status
where variable_name like 'innodb_scrub%';
#
# Test delete of records
#
create table t1 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=compact;
# Populate table with rows
delete from t1;
# restart mysqld so that all pages are flushed
# read all rows from table
select * from t1;
# compact: delete from: grep -c bicycle t1.ibd
0
# compact: delete from: grep -c bicycle ibdata1
0
# compact: delete from: grep -c repairman t1.ibd
0
# compact: delete from: grep -c repairman ibdata1
0
drop table t1;
#
# Test delete+rollback+delete
#
create table t1 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=compact;
# Populate table with rows
begin;
delete from t1;
rollback;
delete from t1;
# restart mysqld so that all pages are flushed
# read all rows from table
select * from t1;
# compact: delete rollback: grep -c bicycle t1.ibd
0
# compact: delete rollback: grep -c bicycle ibdata1
0
# compact: delete rollback: grep -c repairman t1.ibd
0
# compact: delete rollback: grep -c repairman ibdata1
0
drop table t1;
#
# Test insert+rollback
#
create table t1 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=compact;
# Populate table with rows
begin;
rollback;
# restart mysqld so that all pages are flushed
# read all rows from table
select * from t1;
# compact: insert rollback: grep -c bicycle t1.ibd
0
# compact: insert rollback: grep -c bicycle ibdata1
0
# compact: insert rollback: grep -c repairman t1.ibd
0
# compact: insert rollback: grep -c repairman ibdata1
0
drop table t1;
#
# Test delete of records
#
create table t1 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=redundant;
# Populate table with rows
delete from t1;
# restart mysqld so that all pages are flushed
# read all rows from table
select * from t1;
# redundant: delete from: grep -c bicycle t1.ibd
0
# redundant: delete from: grep -c bicycle ibdata1
0
# redundant: delete from: grep -c repairman t1.ibd
0
# redundant: delete from: grep -c repairman ibdata1
0
drop table t1;
#
# Test delete+rollback+delete
#
create table t1 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=redundant;
# Populate table with rows
begin;
delete from t1;
rollback;
delete from t1;
# restart mysqld so that all pages are flushed
# read all rows from table
select * from t1;
# redundant: delete rollback: grep -c bicycle t1.ibd
0
# redundant: delete rollback: grep -c bicycle ibdata1
0
# redundant: delete rollback: grep -c repairman t1.ibd
0
# redundant: delete rollback: grep -c repairman ibdata1
0
drop table t1;
#
# Test insert+rollback
#
create table t1 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=redundant;
# Populate table with rows
begin;
rollback;
# restart mysqld so that all pages are flushed
# read all rows from table
select * from t1;
# redundant: insert rollback: grep -c bicycle t1.ibd
0
# redundant: insert rollback: grep -c bicycle ibdata1
0
# redundant: insert rollback: grep -c repairman t1.ibd
0
# redundant: insert rollback: grep -c repairman ibdata1
0
drop table t1;
#
# Test delete of records
#
create table t1 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=dynamic;
# Populate table with rows
delete from t1;
# restart mysqld so that all pages are flushed
# read all rows from table
select * from t1;
# dynamic: delete from: grep -c bicycle t1.ibd
0
# dynamic: delete from: grep -c bicycle ibdata1
0
# dynamic: delete from: grep -c repairman t1.ibd
0
# dynamic: delete from: grep -c repairman ibdata1
0
drop table t1;
#
# Test delete+rollback+delete
#
create table t1 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=dynamic;
# Populate table with rows
begin;
delete from t1;
rollback;
delete from t1;
# restart mysqld so that all pages are flushed
# read all rows from table
select * from t1;
# dynamic: delete rollback: grep -c bicycle t1.ibd
0
# dynamic: delete rollback: grep -c bicycle ibdata1
0
# dynamic: delete rollback: grep -c repairman t1.ibd
0
# dynamic: delete rollback: grep -c repairman ibdata1
0
drop table t1;
#
# Test insert+rollback
#
create table t1 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=dynamic;
# Populate table with rows
begin;
rollback;
# restart mysqld so that all pages are flushed
# read all rows from table
select * from t1;
# dynamic: insert rollback: grep -c bicycle t1.ibd
0
# dynamic: insert rollback: grep -c bicycle ibdata1
0
# dynamic: insert rollback: grep -c repairman t1.ibd
0
# dynamic: insert rollback: grep -c repairman ibdata1
0
drop table t1;
show variables like 'innodb_%scrub_data%';
Variable_name Value
innodb_background_scrub_data_check_interval 3600
innodb_background_scrub_data_compressed OFF
innodb_background_scrub_data_interval 604800
innodb_background_scrub_data_uncompressed OFF
innodb_immediate_scrub_data_uncompressed ON
# verify that this test have not caused any background scrubbing
select ss.variable_name, gs.variable_value - ss.variable_value as variable_value
from snapshot_status ss,
information_schema.global_status gs
where ss.variable_name = gs.variable_name;
variable_name variable_value
INNODB_SCRUB_BACKGROUND_PAGE_REORGANIZATIONS 0
INNODB_SCRUB_BACKGROUND_PAGE_SPLITS 0
INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_MISSING_INDEX 0
INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_OUT_OF_FILESPACE 0
INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_UNDERFLOW 0
INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_UNKNOWN 0
drop table snapshot_status;
#
# immediate scrubbing is off
# background scrubbing is on
#
show variables like 'innodb_%scrub_data%';
Variable_name Value
innodb_background_scrub_data_check_interval 3600
innodb_background_scrub_data_compressed ON
innodb_background_scrub_data_interval 604800
innodb_background_scrub_data_uncompressed ON
innodb_immediate_scrub_data_uncompressed OFF
# make sure spaces are checked quickly
SET GLOBAL innodb_background_scrub_data_check_interval=1;
create table snapshot_status engine = myisam
select * from information_schema.global_status
where variable_name like 'innodb_scrub%';
truncate table snapshot_status;
insert into snapshot_status
select * from information_schema.global_status
where variable_name like 'innodb_scrub%';
#
# Test delete of records
#
create table t1 (
a int auto_increment primary key,
b varchar(256),
c text, index(b)) engine = innodb row_format=dynamic;
# Populate table with rows
delete from t1;
#
# Test delete+rollback+delete
#
create table t2 (
a int auto_increment primary key,
b varchar(256),
c text, index(b)) engine = innodb row_format=dynamic;
# Populate table with rows
begin;
delete from t2;
rollback;
delete from t2;
#
# Test insert+rollback
#
create table t3 (
a int auto_increment primary key,
b varchar(256),
c text, index(b)) engine = innodb row_format=dynamic;
# Populate table with rows
begin;
rollback;
# start scrubbing threads
SET GLOBAL innodb_encryption_threads=5;
# Wait max 10 min for scrubbing
# Success!
# stop scrubbing threads
SET GLOBAL innodb_encryption_threads=0;
# verify that this test have caused background scrubbing
select sum(gs.variable_value - ss.variable_value) > 0 as should_be_1
from snapshot_status ss,
information_schema.global_status gs
where ss.variable_name = gs.variable_name;
should_be_1
1
# restart mysqld so that all pages are flushed
# read all rows from table
select * from t1;
# dynamic: delete: grep -c bicycle t1.ibd
0
# dynamic: delete: grep -c repairman t1.ibd
0
# dynamic: delete rollback: grep -c bicycle t2.ibd
0
# dynamic: delete rollback: grep -c repairman t2.ibd
0
# dynamic: insert rollback: grep -c bicycle t3.ibd
0
# dynamic: insert rollback: grep -c repairman t3.ibd
0
drop table t1, t2, t3;
show variables like 'innodb_%scrub_data%';
Variable_name Value
innodb_background_scrub_data_check_interval 3600
innodb_background_scrub_data_compressed ON
innodb_background_scrub_data_interval 604800
innodb_background_scrub_data_uncompressed ON
innodb_immediate_scrub_data_uncompressed OFF
drop table snapshot_status;
# make sure spaces are checked quickly
SET GLOBAL innodb_background_scrub_data_check_interval=1;
#
# Test delete of records
#
create table t1 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=compressed;
# Populate table with rows
delete from t1;
#
# Test delete+rollback+delete
#
create table t2 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=compressed;
# Populate table with rows
begin;
delete from t2;
rollback;
delete from t2;
#
# Test insert+rollback
#
create table t3 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=compressed;
# Populate table with rows
begin;
rollback;
# start scrubbing threads
SET GLOBAL innodb_encryption_threads=5;
# Wait max 10 min for scrubbing of this table
# Success!
# stop scrubbing threads
SET GLOBAL innodb_encryption_threads=0;
# Now there should be background scrubs
# restart mysqld so that all pages are flushed (encryption off)
# so that grep will find stuff
# read all rows from table
select * from t1;
select * from t2;
select * from t3;
# grep -c bicycle t1.ibd
0
# grep -c bicycle ibdata1
0
# grep -c repairman t1.ibd
0
# grep -c repairman ibdata1
0
# grep -c boondoggle t2.ibd
0
# grep -c boondoggle ibdata1
0
# grep -c waste t2.ibd
0
# grep -c waste ibdata1
0
# grep -c keso t3.ibd
0
# grep -c keso ibdata1
0
# grep -c kent t3.ibd
0
# grep -c kent ibdata1
0
drop table t1, t2, t3;
--default-storage-engine=InnoDB
--encryption-algorithm=aes_cbs
--file-key-management-plugin-filename=$MYSQL_TEST_DIR/suite/innodb/include/keys.txt
--innodb-buffer-pool-size=24M
--source include/no_valgrind_without_big.inc
# Tests for setting innodb-page-size=32k;
--source include/have_xtradb.inc
--source include/have_innodb_32k.inc
call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
--disable_query_log
# These values can change during the test
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact page_encryption=1 page_encryption_key=1;
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_encryption=1 page_encryption_key=3;
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant page_encryption=1 page_encryption_key=4;
show create table innodb_compact;
show create table innodb_dynamic;
show create table innodb_redundant;
delimiter //;
create procedure innodb_insert_proc (repeat_count int)
begin
declare current_num int;
set current_num = 0;
while current_num < repeat_count do
insert into innodb_normal values(current_num, substring(MD5(RAND()), -150));
set current_num = current_num + 1;
end while;
end//
delimiter ;//
commit;
set autocommit=0;
call innodb_insert_proc(5000);
commit;
set autocommit=1;
insert into innodb_compact select * from innodb_normal;
insert into innodb_dynamic select * from innodb_normal;
insert into innodb_redundant select * from innodb_normal;
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
update innodb_redundant set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000;
select count(*) from innodb_dynamic where c1 < 1500000;
select count(*) from innodb_redundant where c1 < 1500000;
--source include/restart_mysqld.inc
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
update innodb_redundant set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000;
select count(*) from innodb_dynamic where c1 < 1500000;
select count(*) from innodb_redundant where c1 < 1500000;
alter table innodb_compact engine=innodb page_encryption=0;
show create table innodb_compact;
alter table innodb_dynamic engine=innodb page_encryption=0;
show create table innodb_dynamic;
alter table innodb_redundant engine=innodb page_encryption=0;
show create table innodb_redundant;
--source include/restart_mysqld.inc
show create table innodb_compact;
show create table innodb_dynamic;
show create table innodb_redundant;
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
update innodb_redundant set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000;
select count(*) from innodb_dynamic where c1 < 1500000;
select count(*) from innodb_redundant where c1 < 1500000;
drop procedure innodb_insert_proc;
drop table innodb_normal;
drop table innodb_compact;
drop table innodb_dynamic;
drop table innodb_redundant;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log
--enable-file-key-management-plugin
--encryption-algorithm=aes_cbs
--file-key-management-plugin-filename=$MYSQL_TEST_DIR/suite/innodb/include/keys.txt
-- source include/have_innodb.inc
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact page_encryption=1 page_encryption_key=1;
create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed page_encryption=1 page_encryption_key=2;
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_encryption=1 page_encryption_key=3;
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant page_encryption=1 page_encryption_key=4;
show create table innodb_compact;
show create table innodb_compressed;
show create table innodb_dynamic;
show create table innodb_redundant;
delimiter //;
create procedure innodb_insert_proc (repeat_count int)
begin
declare current_num int;
set current_num = 0;
while current_num < repeat_count do
insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
set current_num = current_num + 1;
end while;
end//
delimiter ;//
commit;
set autocommit=0;
call innodb_insert_proc(5000);
commit;
set autocommit=1;
insert into innodb_compact select * from innodb_normal;
insert into innodb_compressed select * from innodb_normal;
insert into innodb_dynamic select * from innodb_normal;
insert into innodb_redundant select * from innodb_normal;
update innodb_compact set c1 = c1 + 1;
update innodb_compressed set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
update innodb_redundant set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000;
select count(*) from innodb_compressed where c1 < 1500000;
select count(*) from innodb_dynamic where c1 < 1500000;
select count(*) from innodb_redundant where c1 < 1500000;
# Note there that these variables are updated only when real I/O is done, thus they are not reliable
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encrypted';
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decrypted';
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encryption_error';
--source include/restart_mysqld.inc
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
update innodb_compact set c1 = c1 + 1;
update innodb_compressed set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
update innodb_redundant set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000;
select count(*) from innodb_compressed where c1 < 1500000;
select count(*) from innodb_dynamic where c1 < 1500000;
select count(*) from innodb_redundant where c1 < 1500000;
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encrypted';
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decrypted';
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encryption_error';
alter table innodb_compact engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT;
show create table innodb_compact;
alter table innodb_compressed engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT;
show create table innodb_compressed;
alter table innodb_dynamic engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT;
show create table innodb_dynamic;
alter table innodb_redundant engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT;
show create table innodb_redundant;
--source include/restart_mysqld.inc
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
show create table innodb_compact;
show create table innodb_compressed;
show create table innodb_dynamic;
show create table innodb_redundant;
update innodb_compact set c1 = c1 + 1;
update innodb_compressed set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
update innodb_redundant set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000;
select count(*) from innodb_compressed where c1 < 1500000;
select count(*) from innodb_dynamic where c1 < 1500000;
select count(*) from innodb_redundant where c1 < 1500000;
# After alter+restart these should be 0
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encrypted';
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decrypted';
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encryption_error';
drop procedure innodb_insert_proc;
drop table innodb_normal;
drop table innodb_compact;
drop table innodb_compressed;
drop table innodb_dynamic;
drop table innodb_redundant;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log
--enable-file-key-management-plugin
--encryption-algorithm=aes_cbs
--file-key-management-plugin-filename=$MYSQL_TEST_DIR/suite/innodb/include/keys.txt
-- source include/have_innodb.inc
--disable_query_log
let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
# zlib
set global innodb_compression_algorithm = 1;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb page_compressed=1;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact page_encryption=1 page_encryption_key=1 page_compressed=1;
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_encryption=1 page_encryption_key=2 page_compressed=1;
show warnings;
show create table innodb_normal;
show create table innodb_compact;
show create table innodb_dynamic;
delimiter //;
create procedure innodb_insert_proc (repeat_count int)
begin
declare current_num int;
set current_num = 0;
while current_num < repeat_count do
insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
set current_num = current_num + 1;
end while;
end//
delimiter ;//
commit;
set autocommit=0;
call innodb_insert_proc(5000);
commit;
set autocommit=1;
insert into innodb_compact select * from innodb_normal;
insert into innodb_dynamic select * from innodb_normal;
update innodb_normal set c1 = c1 + 1;
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
select count(*) from innodb_normal;
select count(*) from innodb_compact where c1 < 1500000;
select count(*) from innodb_dynamic where c1 < 1500000;
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encrypted';
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decrypted';
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encryption_error';
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_compressed';
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed';
--source include/restart_mysqld.inc
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
# zlib
set global innodb_compression_algorithm = 1;
update innodb_normal set c1 = c1 + 1;
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
select count(*) from innodb_normal;
select count(*) from innodb_compact where c1 < 1500000;
select count(*) from innodb_dynamic where c1 < 1500000;
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encrypted';
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decrypted';
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encryption_error';
SELECT variable_value > 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_compressed';
SELECT variable_value > 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed';
alter table innodb_normal engine=innodb page_compressed=DEFAULT;
show create table innodb_normal;
alter table innodb_compact engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT page_compressed=DEFAULT;
show create table innodb_compact;
alter table innodb_dynamic engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT page_compressed=DEFAULT;
show create table innodb_dynamic;
--source include/restart_mysqld.inc
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
show create table innodb_normal;
show create table innodb_compact;
show create table innodb_dynamic;
update innodb_normal set c1 = c1 + 1;
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
select count(*) from innodb_normal;
select count(*) from innodb_compact where c1 < 1500000;
select count(*) from innodb_dynamic where c1 < 1500000;
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encrypted';
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decrypted';
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encryption_error';
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_compressed';
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed';
drop procedure innodb_insert_proc;
drop table innodb_normal;
drop table innodb_compact;
drop table innodb_dynamic;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig;
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
# Test opening a corrupted table. # Test opening a corrupted table.
# #
-- source include/not_encrypted.inc
# Don't test under valgrind, memory leaks will occur # Don't test under valgrind, memory leaks will occur
source include/not_valgrind.inc; source include/not_valgrind.inc;
# Avoid CrashReporter popup on Mac # Avoid CrashReporter popup on Mac
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
-- source include/not_embedded.inc -- source include/not_embedded.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/have_innodb_16k.inc -- source include/have_innodb_16k.inc
-- source include/not_encrypted.inc
call mtr.add_suppression('InnoDB: Error: Table "mysql"."innodb_(table|index)_stats" not found'); call mtr.add_suppression('InnoDB: Error: Table "mysql"."innodb_(table|index)_stats" not found');
call mtr.add_suppression('InnoDB: Error: Fetch of persistent statistics requested'); call mtr.add_suppression('InnoDB: Error: Fetch of persistent statistics requested');
......
--enable-example-key-management-plugin
--encrypt-tmp-disk-tables=ON
--aria-encrypt-tables=ON
--innodb-encryption-threads=4
--innodb-encryption-rotate-key-age=15
--innodb-encrypt-tables=ON
--innodb-tablespaces-encryption
--encryption-algorithm=aes_ctr
#
#
#
-- source include/have_innodb.inc
# embedded does not support restart
-- source include/not_embedded.inc
SET @start_global_value = @@global.innodb_encryption_threads;
SHOW VARIABLES LIKE 'innodb_encrypt%';
DESCRIBE INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
--echo # Wait max 5 min for key encryption threads to encrypt one space
let $cnt=300;
while ($cnt)
{
let $success=`SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION > 0`;
if ($success)
{
let $cnt=0;
}
if (!$success)
{
real_sleep 1;
dec $cnt;
}
}
if (!$success)
{
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
SHOW STATUS LIKE 'innodb_encryption%';
-- die Timeout waiting for encryption threads
}
--echo # Success!
--echo # Wait max 10 min for key encryption threads to encrypt all space
let $cnt=600;
while ($cnt)
{
let $success=`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0`;
if ($success)
{
let $cnt=0;
}
if (!$success)
{
real_sleep 1;
dec $cnt;
}
}
if (!$success)
{
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
SHOW STATUS LIKE 'innodb_encryption%';
-- die Timeout waiting for encryption threads
}
--echo # Success!
--echo # Now turn off encryption and wait for threads to decrypt everything
SET GLOBAL innodb_encrypt_tables = off;
--echo # Wait max 10 min for key encryption threads to decrypt all space
let $cnt=600;
while ($cnt)
{
let $success=`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0`;
if ($success)
{
let $cnt=0;
}
if (!$success)
{
real_sleep 1;
dec $cnt;
}
}
if (!$success)
{
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
SHOW STATUS LIKE 'innodb_encryption%';
-- die Timeout waiting for encryption threads
}
--echo # Success!
--echo # Shutdown innodb_encryption_threads
SET GLOBAL innodb_encryption_threads=0;
--echo # Turn on encryption
--echo # since threads are off tables should remain unencrypted
SET GLOBAL innodb_encrypt_tables = on;
--echo # Wait 15s to check that nothing gets encrypted
let $cnt=15;
while ($cnt)
{
let $success=`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0`;
if ($success)
{
real_sleep 1;
dec $cnt;
}
if (!$success)
{
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
-- die Failure, tablespace getting encrypted even if innodb_encryption_threads=0
}
}
--echo # Success!
--echo # Startup innodb_encryption_threads
SET GLOBAL innodb_encryption_threads=@start_global_value;
--echo # Wait 1 min to check that it start encrypting again
let $cnt=60;
while ($cnt)
{
let $success=`SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 OR KEY_ROTATION_PAGE_NUMBER IS NOT NULL`;
if ($success)
{
let $cnt=0;
}
if (!$success)
{
real_sleep 1;
dec $cnt;
}
}
if (!$success)
{
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
SHOW STATUS LIKE 'innodb_encryption%';
-- die Timeout waiting for encryption threads
}
--echo # Success!
--echo #
--echo # Check that restart with encryption turned off works
--echo # even if spaces are encrypted
--echo #
--echo # First wait max 10 min for key encryption threads to encrypt all spaces
let $cnt=600;
while ($cnt)
{
let $success=`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0`;
if ($success)
{
let $cnt=0;
}
if (!$success)
{
real_sleep 1;
dec $cnt;
}
}
if (!$success)
{
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
SHOW STATUS LIKE 'innodb_encryption%';
-- die Timeout waiting for encryption threads
}
--echo # Success!
--echo # Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
-- let $restart_parameters=--innodb_encrypt_tables=0 --innodb_encryption_threads=0
-- source include/restart_mysqld.inc
SHOW VARIABLES LIKE 'innodb_encrypt%';
SELECT COUNT(*) > 0 as should_be_1
FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
WHERE MIN_KEY_VERSION <> 0;
--echo # Restart mysqld again...with default options
-- let $restart_parameters=
-- source include/restart_mysqld.inc
...@@ -5,6 +5,13 @@ ...@@ -5,6 +5,13 @@
-- source include/have_innodb.inc -- source include/have_innodb.inc
# lock data that is part of result set for this testcase
# is retreived using buf_page_try_get. i.e only show if page
# happen to be in buffer pool, with key rotation threads
# chances are substantial that pages have been evicted and lock_data
# get NULL
-- source include/not_encrypted.inc
-- disable_query_log -- disable_query_log
-- disable_result_log -- disable_result_log
......
# Exercise the code path for INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS # Exercise the code path for INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS
# and INFORMATION_SCHEMA.INNODB_BUFFER_PAGE # and INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
# This test assumes that buffer pool is idle
# with key rotation threads buffer pages gets evicted this
# testcase gets flaky
-- source include/not_encrypted.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- disable_result_log -- disable_result_log
......
--enable-example-key-management-plugin
--innodb-background-scrub-data-compressed=OFF
--innodb-background-scrub-data-uncompressed=OFF
--innodb-encrypt-tables=0
--innodb-encryption-threads=0
--innodb-file-format=Barracuda
--innodb-file-per-table=1
--innodb-immediate-scrub-data-uncompressed=ON
--loose-aria-encrypt-tables=ON
--loose-encrypt-tmp-disk-tables=ON
--loose-innodb-encrypt-tables=ON
--loose-innodb-encryption-rotate-key-age=15
--loose-innodb-encryption-threads=4
--loose-innodb-scrub-force-testing=ON
-- source include/have_innodb.inc
-- source include/not_embedded.inc
let $MYSQLD_DATADIR=`select @@datadir`;
let ib1_IBD = $MYSQLD_DATADIR/ibdata1;
let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd;
create table snapshot_status engine = myisam
select * from information_schema.global_status
where variable_name like 'innodb_scrub%';
let $rowcount=500;
let $formatno = 3;
while ($formatno)
{
let $format = `select case $formatno
when 1 then 'dynamic'
when 2 then 'redundant'
when 3 then 'compact'
end`;
dec $formatno;
-- echo #
-- echo # Test delete of records
-- echo #
eval create table t1 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=$format;
let $numinserts = $rowcount;
-- echo # Populate table with rows
--disable_query_log
while ($numinserts)
{
dec $numinserts;
insert into t1(b,c) values ('bicycle', repeat('repairman', 1000));
}
--enable_query_log
delete from t1;
-- echo # restart mysqld so that all pages are flushed
-- source include/restart_mysqld.inc
-- echo # read all rows from table
-- disable_result_log
select * from t1;
-- enable_result_log
-- echo # $format: delete from: grep -c bicycle t1.ibd
-- exec grep -c bicycle $t1_IBD || true
-- echo # $format: delete from: grep -c bicycle ibdata1
-- exec grep -c bicycle $ib1_IBD || true
-- echo # $format: delete from: grep -c repairman t1.ibd
-- exec grep -c repairman $t1_IBD || true
-- echo # $format: delete from: grep -c repairman ibdata1
-- exec grep -c repairman $ib1_IBD || true
drop table t1;
-- echo #
-- echo # Test delete+rollback+delete
-- echo #
eval create table t1 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=$format;
let $numinserts = $rowcount;
-- echo # Populate table with rows
--disable_query_log
while ($numinserts)
{
dec $numinserts;
insert into t1(b,c) values ('bicycle', repeat('repairman', 1000));
}
--enable_query_log
begin;
delete from t1;
rollback;
delete from t1;
-- echo # restart mysqld so that all pages are flushed
-- source include/restart_mysqld.inc
-- echo # read all rows from table
-- disable_result_log
select * from t1;
-- enable_result_log
-- echo # $format: delete rollback: grep -c bicycle t1.ibd
-- exec grep -c bicycle $t1_IBD || true
-- echo # $format: delete rollback: grep -c bicycle ibdata1
-- exec grep -c bicycle $ib1_IBD || true
-- echo # $format: delete rollback: grep -c repairman t1.ibd
-- exec grep -c repairman $t1_IBD || true
-- echo # $format: delete rollback: grep -c repairman ibdata1
-- exec grep -c repairman $ib1_IBD || true
drop table t1;
-- echo #
-- echo # Test insert+rollback
-- echo #
eval create table t1 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=$format;
let $numinserts = $rowcount;
-- echo # Populate table with rows
begin;
--disable_query_log
while ($numinserts)
{
dec $numinserts;
insert into t1(b,c) values ('bicycle', repeat('repairman', 1000));
}
--enable_query_log
rollback;
-- echo # restart mysqld so that all pages are flushed
-- source include/restart_mysqld.inc
-- echo # read all rows from table
-- disable_result_log
select * from t1;
-- enable_result_log
-- echo # $format: insert rollback: grep -c bicycle t1.ibd
-- exec grep -c bicycle $t1_IBD || true
-- echo # $format: insert rollback: grep -c bicycle ibdata1
-- exec grep -c bicycle $ib1_IBD || true
-- echo # $format: insert rollback: grep -c repairman t1.ibd
-- exec grep -c repairman $t1_IBD || true
-- echo # $format: insert rollback: grep -c repairman ibdata1
-- exec grep -c repairman $ib1_IBD || true
drop table t1;
}
show variables like 'innodb_%scrub_data%';
--echo # verify that this test have not caused any background scrubbing
--sorted_result
select ss.variable_name, gs.variable_value - ss.variable_value as variable_value
from snapshot_status ss,
information_schema.global_status gs
where ss.variable_name = gs.variable_name;
drop table snapshot_status;
--enable-example-key-management-plugin
--innodb-background-scrub-data-compressed=ON
--innodb-background-scrub-data-uncompressed=ON
--innodb-encrypt-tables=0
--innodb-encryption-threads=0
--innodb-file-format=Barracuda
--innodb-file-per-table=1
--innodb-immediate-scrub-data-uncompressed=OFF
--innodb-tablespaces-scrubbing
--loose-aria-encrypt-tables=ON
--loose-encrypt-tmp-disk-tables=ON
--loose-innodb-encrypt-tables=ON
--loose-innodb-encryption-rotate-key-age=15
--loose-innodb-encryption-threads=4
--loose-innodb-scrub-force-testing=ON
-- source include/have_innodb.inc
-- source include/not_embedded.inc
let $MYSQLD_DATADIR=`select @@datadir`;
let ib1_IBD = $MYSQLD_DATADIR/ibdata1;
let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd;
let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd;
let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd;
--echo #
--echo # immediate scrubbing is off
--echo # background scrubbing is on
--echo #
show variables like 'innodb_%scrub_data%';
-- echo # make sure spaces are checked quickly
SET GLOBAL innodb_background_scrub_data_check_interval=1;
create table snapshot_status engine = myisam
select * from information_schema.global_status
where variable_name like 'innodb_scrub%';
let $rowcount=500;
let $formatno = 1;
while ($formatno)
{
let $format = `select case $formatno
when 1 then 'dynamic'
when 2 then 'redundant'
when 3 then 'compact'
when 4 then 'compressed'
end`;
dec $formatno;
truncate table snapshot_status;
insert into snapshot_status
select * from information_schema.global_status
where variable_name like 'innodb_scrub%';
-- echo #
-- echo # Test delete of records
-- echo #
eval create table t1 (
a int auto_increment primary key,
b varchar(256),
c text, index(b)) engine = innodb row_format=$format;
let $numinserts = $rowcount;
-- echo # Populate table with rows
--disable_query_log
while ($numinserts)
{
dec $numinserts;
insert into t1(b,c) values ('bicycle', repeat('repairman', 1000));
}
--enable_query_log
delete from t1;
-- echo #
-- echo # Test delete+rollback+delete
-- echo #
eval create table t2 (
a int auto_increment primary key,
b varchar(256),
c text, index(b)) engine = innodb row_format=$format;
let $numinserts = $rowcount;
-- echo # Populate table with rows
--disable_query_log
while ($numinserts)
{
dec $numinserts;
insert into t2(b,c) values ('bicycle', repeat('repairman', 1000));
}
--enable_query_log
begin;
delete from t2;
rollback;
delete from t2;
-- echo #
-- echo # Test insert+rollback
-- echo #
eval create table t3 (
a int auto_increment primary key,
b varchar(256),
c text, index(b)) engine = innodb row_format=$format;
let $numinserts = $rowcount;
-- echo # Populate table with rows
begin;
--disable_query_log
while ($numinserts)
{
dec $numinserts;
insert into t3(b,c) values ('bicycle', repeat('repairman', 1000));
}
--enable_query_log
rollback;
-- echo # start scrubbing threads
SET GLOBAL innodb_encryption_threads=5;
-- echo # Wait max 10 min for scrubbing
let $cnt=600;
while ($cnt)
{
let $success=`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING WHERE LAST_SCRUB_COMPLETED IS NULL AND ( NAME in ('test/t1', 'test/t2', 'test/t3') OR SPACE = 0 )`;
if ($success)
{
let $cnt=0;
}
if (!$success)
{
real_sleep 1;
dec $cnt;
}
}
if (!$success)
{
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING;
SHOW STATUS LIKE 'innodb_%scrub%';
-- die Timeout waiting for background threads
}
-- echo # Success!
-- echo # stop scrubbing threads
SET GLOBAL innodb_encryption_threads=0;
-- echo # verify that this test have caused background scrubbing
--sorted_result
select sum(gs.variable_value - ss.variable_value) > 0 as should_be_1
from snapshot_status ss,
information_schema.global_status gs
where ss.variable_name = gs.variable_name;
-- echo # restart mysqld so that all pages are flushed
-- source include/restart_mysqld.inc
-- echo # read all rows from table
-- disable_result_log
select * from t1;
-- enable_result_log
-- echo # $format: delete: grep -c bicycle t1.ibd
-- exec grep -c bicycle $t1_IBD || true
-- echo # $format: delete: grep -c repairman t1.ibd
-- exec grep -c repairman $t1_IBD || true
-- echo # $format: delete rollback: grep -c bicycle t2.ibd
-- exec grep -c bicycle $t2_IBD || true
-- echo # $format: delete rollback: grep -c repairman t2.ibd
-- exec grep -c repairman $t2_IBD || true
-- echo # $format: insert rollback: grep -c bicycle t3.ibd
-- exec grep -c bicycle $t3_IBD || true
-- echo # $format: insert rollback: grep -c repairman t3.ibd
-- exec grep -c repairman $t3_IBD || true
drop table t1, t2, t3;
}
show variables like 'innodb_%scrub_data%';
drop table snapshot_status;
--enable-example-key-management-plugin
--innodb-background-scrub-data-compressed=ON
--innodb-background-scrub-data-uncompressed=ON
--innodb-encrypt-tables=off
--innodb-encryption-threads=0
--innodb-file-format=Barracuda
--innodb-file-per-table=1
--innodb-immediate-scrub-data-uncompressed=ON
--innodb-tablespaces-scrubbing
--loose-aria-encrypt-tables=ON
--loose-encrypt-tmp-disk-tables=ON
--loose-innodb-encrypt-tables=ON
--loose-innodb-encryption-rotate-key-age=15
--loose-innodb-encryption-threads=4
--loose-innodb-scrub-force-testing=ON
-- source include/have_innodb.inc
-- source include/not_embedded.inc
let $MYSQLD_DATADIR=`select @@datadir`;
let ib1_IBD = $MYSQLD_DATADIR/ibdata1;
let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd;
let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd;
let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd;
let $rowcount=500;
-- echo # make sure spaces are checked quickly
SET GLOBAL innodb_background_scrub_data_check_interval=1;
-- echo #
-- echo # Test delete of records
-- echo #
eval create table t1 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=compressed;
let $numinserts = $rowcount;
-- echo # Populate table with rows
--disable_query_log
while ($numinserts)
{
dec $numinserts;
insert into t1(b,c) values ('bicycle', repeat('repairman', 1000));
}
--enable_query_log
delete from t1;
-- echo #
-- echo # Test delete+rollback+delete
-- echo #
eval create table t2 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=compressed;
let $numinserts = $rowcount;
-- echo # Populate table with rows
--disable_query_log
while ($numinserts)
{
dec $numinserts;
insert into t2(b,c) values ('boondoggle', repeat('waste of time', 1000));
}
--enable_query_log
begin;
delete from t2;
rollback;
delete from t2;
-- echo #
-- echo # Test insert+rollback
-- echo #
eval create table t3 (
a int auto_increment primary key,
b varchar(256),
c text) engine = innodb row_format=compressed;
let $numinserts = $rowcount;
-- echo # Populate table with rows
begin;
--disable_query_log
while ($numinserts)
{
dec $numinserts;
insert into t3(b,c) values ('keso', repeat('kent', 1000));
}
--enable_query_log
rollback;
-- echo # start scrubbing threads
SET GLOBAL innodb_encryption_threads=5;
-- echo # Wait max 10 min for scrubbing of this table
let $cnt=600;
while ($cnt)
{
let $success=`SELECT COUNT(*) = 0
FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING
WHERE LAST_SCRUB_COMPLETED IS NULL AND ( NAME like 'test/%' OR SPACE = 0 )`;
if ($success)
{
let $cnt=0;
}
if (!$success)
{
real_sleep 1;
dec $cnt;
}
}
if (!$success)
{
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING;
SHOW STATUS LIKE 'innodb_%scrub%';
-- die Timeout waiting for background threads
}
-- echo # Success!
-- echo # stop scrubbing threads
SET GLOBAL innodb_encryption_threads=0;
--echo # Now there should be background scrubs
let $success=`select sum(variable_value) > 0
from information_schema.global_status
where variable_name in ('innodb_scrub_background_page_reorganizations',
'innodb_scrub_background_page_splits')`;
if (!$success) {
show status like 'innodb_scrub%';
}
-- echo # restart mysqld so that all pages are flushed (encryption off)
-- echo # so that grep will find stuff
-- source include/restart_mysqld.inc
-- echo # read all rows from table
-- disable_result_log
select * from t1;
select * from t2;
select * from t3;
-- enable_result_log
-- echo # grep -c bicycle t1.ibd
-- exec grep -c bicycle $t1_IBD || true
-- echo # grep -c bicycle ibdata1
-- exec grep -c bicycle $ib1_IBD || true
-- echo # grep -c repairman t1.ibd
-- exec grep -c repairman $t1_IBD || true
-- echo # grep -c repairman ibdata1
-- exec grep -c repairman $ib1_IBD || true
-- echo # grep -c boondoggle t2.ibd
-- exec grep -c boondoggle $t2_IBD || true
-- echo # grep -c boondoggle ibdata1
-- exec grep -c boondoggle $ib1_IBD || true
-- echo # grep -c waste t2.ibd
-- exec grep -c waste $t2_IBD || true
-- echo # grep -c waste ibdata1
-- exec grep -c waste $ib1_IBD || true
-- echo # grep -c keso t3.ibd
-- exec grep -c keso $t3_IBD || true
-- echo # grep -c keso ibdata1
-- exec grep -c keso $ib1_IBD || true
-- echo # grep -c kent t3.ibd
-- exec grep -c kent $t3_IBD || true
-- echo # grep -c kent ibdata1
-- exec grep -c kent $ib1_IBD || true
drop table t1, t2, t3;
--source include/have_innodb.inc --source include/have_innodb.inc
# lazy evition might not be lazy enough when key rotation
# scans through pages
-- source include/not_encrypted.inc
let $per_table=`select @@innodb_file_per_table`; let $per_table=`select @@innodb_file_per_table`;
let $format=`select @@innodb_file_format`; let $format=`select @@innodb_file_format`;
......
...@@ -78,7 +78,7 @@ ERROR HY000: Lost connection to MySQL server during query ...@@ -78,7 +78,7 @@ ERROR HY000: Lost connection to MySQL server during query
* recovery happens * recovery happens
check table t1 extended; check table t1 extended;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
mysqltest.t1 check warning Size of indexfile is: 372 Expected: 8192 mysqltest.t1 check warning Size of indexfile is: <SIZE> Expected: 8192
mysqltest.t1 check status OK mysqltest.t1 check status OK
* testing that checksum after recovery is as expected * testing that checksum after recovery is as expected
Checksum-check Checksum-check
......
...@@ -305,6 +305,7 @@ Variable_name Value ...@@ -305,6 +305,7 @@ Variable_name Value
aria_block_size 8192 aria_block_size 8192
aria_checkpoint_interval 30 aria_checkpoint_interval 30
aria_checkpoint_log_activity 1048576 aria_checkpoint_log_activity 1048576
aria_encrypt_tables OFF
aria_force_start_after_recovery_failures 0 aria_force_start_after_recovery_failures 0
aria_group_commit none aria_group_commit none
aria_group_commit_interval 0 aria_group_commit_interval 0
......
SET @start_global_value = @@global.aria_encrypt_tables;
select @@global.aria_encrypt_tables;
@@global.aria_encrypt_tables
0
select @@session.aria_encrypt_tables;
ERROR HY000: Variable 'aria_encrypt_tables' is a GLOBAL variable
show global variables like 'aria_encrypt_tables';
Variable_name Value
aria_encrypt_tables OFF
show session variables like 'aria_encrypt_tables';
Variable_name Value
aria_encrypt_tables OFF
select * from information_schema.global_variables
where variable_name='aria_encrypt_tables';
VARIABLE_NAME VARIABLE_VALUE
ARIA_ENCRYPT_TABLES OFF
select * from information_schema.session_variables
where variable_name='aria_encrypt_tables';
VARIABLE_NAME VARIABLE_VALUE
ARIA_ENCRYPT_TABLES OFF
set global aria_encrypt_tables=ON;
select @@global.aria_encrypt_tables;
@@global.aria_encrypt_tables
1
set global aria_encrypt_tables=OFF;
select @@global.aria_encrypt_tables;
@@global.aria_encrypt_tables
0
set global aria_encrypt_tables=1;
select @@global.aria_encrypt_tables;
@@global.aria_encrypt_tables
1
set session aria_encrypt_tables=1;
ERROR HY000: Variable 'aria_encrypt_tables' is a GLOBAL variable and should be set with SET GLOBAL
set global aria_encrypt_tables=1.1;
ERROR 42000: Incorrect argument type to variable 'aria_encrypt_tables'
set global aria_encrypt_tables=1e1;
ERROR 42000: Incorrect argument type to variable 'aria_encrypt_tables'
set global aria_encrypt_tables="foo";
ERROR 42000: Variable 'aria_encrypt_tables' can't be set to the value of 'foo'
SET @@global.aria_encrypt_tables = @start_global_value;
show global variables like "debug_use_static_encryption_keys";
Variable_name Value
debug_use_static_encryption_keys OFF
SET @start_global_value = @@global.encrypt_tmp_disk_tables;
select @@global.encrypt_tmp_disk_tables;
@@global.encrypt_tmp_disk_tables
0
select @@session.encrypt_tmp_disk_tables;
ERROR HY000: Variable 'encrypt_tmp_disk_tables' is a GLOBAL variable
show global variables like 'encrypt_tmp_disk_tables';
Variable_name Value
encrypt_tmp_disk_tables OFF
show session variables like 'encrypt_tmp_disk_tables';
Variable_name Value
encrypt_tmp_disk_tables OFF
select * from information_schema.global_variables
where variable_name='encrypt_tmp_disk_tables';
VARIABLE_NAME VARIABLE_VALUE
ENCRYPT_TMP_DISK_TABLES OFF
select * from information_schema.session_variables
where variable_name='encrypt_tmp_disk_tables';
VARIABLE_NAME VARIABLE_VALUE
ENCRYPT_TMP_DISK_TABLES OFF
set global encrypt_tmp_disk_tables=ON;
select @@global.encrypt_tmp_disk_tables;
@@global.encrypt_tmp_disk_tables
1
set global encrypt_tmp_disk_tables=OFF;
select @@global.encrypt_tmp_disk_tables;
@@global.encrypt_tmp_disk_tables
0
set global encrypt_tmp_disk_tables=1;
select @@global.encrypt_tmp_disk_tables;
@@global.encrypt_tmp_disk_tables
1
set session encrypt_tmp_disk_tables=1;
ERROR HY000: Variable 'encrypt_tmp_disk_tables' is a GLOBAL variable and should be set with SET GLOBAL
set global encrypt_tmp_disk_tables=1.1;
ERROR 42000: Incorrect argument type to variable 'encrypt_tmp_disk_tables'
set global encrypt_tmp_disk_tables=1e1;
ERROR 42000: Incorrect argument type to variable 'encrypt_tmp_disk_tables'
set global encrypt_tmp_disk_tables="foo";
ERROR 42000: Variable 'encrypt_tmp_disk_tables' can't be set to the value of 'foo'
SET @@global.encrypt_tmp_disk_tables = @start_global_value;
select @@global.encryption_algorithm;
@@global.encryption_algorithm
none
select @@session.encryption_algorithm;
ERROR HY000: Variable 'encryption_algorithm' is a GLOBAL variable
set global encryption_algorithm="none";
ERROR HY000: Variable 'encryption_algorithm' is a read only variable
SET @start_global_value = @@global.innodb_background_scrub_data_check_interval;
#
# default value
#
select @@global.innodb_background_scrub_data_check_interval;
@@global.innodb_background_scrub_data_check_interval
3600
set global innodb_background_scrub_data_check_interval=10;
select @@global.innodb_background_scrub_data_check_interval;
@@global.innodb_background_scrub_data_check_interval
10
set global innodb_background_scrub_data_check_interval=DEFAULT;
select @@global.innodb_background_scrub_data_check_interval;
@@global.innodb_background_scrub_data_check_interval
3600
set global innodb_background_scrub_data_check_interval=20;
select @@global.innodb_background_scrub_data_check_interval;
@@global.innodb_background_scrub_data_check_interval
20
set global innodb_background_scrub_data_check_interval=DEFAULT;
select @@global.innodb_background_scrub_data_check_interval;
@@global.innodb_background_scrub_data_check_interval
3600
#
# exists as global only
#
select @@global.innodb_background_scrub_data_check_interval;
@@global.innodb_background_scrub_data_check_interval
3600
select @@session.innodb_background_scrub_data_check_interval;
ERROR HY000: Variable 'innodb_background_scrub_data_check_interval' is a GLOBAL variable
show global variables like 'innodb_background_scrub_data_check_interval';
Variable_name Value
innodb_background_scrub_data_check_interval 3600
show session variables like 'innodb_background_scrub_data_check_interval';
Variable_name Value
innodb_background_scrub_data_check_interval 3600
select * from information_schema.global_variables
where variable_name='innodb_background_scrub_data_check_interval';
VARIABLE_NAME VARIABLE_VALUE
INNODB_BACKGROUND_SCRUB_DATA_CHECK_INTERVAL 3600
select * from information_schema.session_variables
where variable_name='innodb_background_scrub_data_check_interval';
VARIABLE_NAME VARIABLE_VALUE
INNODB_BACKGROUND_SCRUB_DATA_CHECK_INTERVAL 3600
#
# show that it's writable
#
set global innodb_background_scrub_data_check_interval=10;
select @@global.innodb_background_scrub_data_check_interval;
@@global.innodb_background_scrub_data_check_interval
10
set global innodb_background_scrub_data_check_interval=20;
select @@global.innodb_background_scrub_data_check_interval;
@@global.innodb_background_scrub_data_check_interval
20
set global innodb_background_scrub_data_check_interval=1;
select @@global.innodb_background_scrub_data_check_interval;
@@global.innodb_background_scrub_data_check_interval
1
set session innodb_background_scrub_data_check_interval=1;
ERROR HY000: Variable 'innodb_background_scrub_data_check_interval' is a GLOBAL variable and should be set with SET GLOBAL
#
# incorrect types
#
set global innodb_background_scrub_data_check_interval=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_check_interval'
set global innodb_background_scrub_data_check_interval=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_check_interval'
set global innodb_background_scrub_data_check_interval="foo";
ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_check_interval'
SET @@global.innodb_background_scrub_data_check_interval = @start_global_value;
SET @start_global_value = @@global.innodb_background_scrub_data_compressed;
#
# exists as global only
#
select @@global.innodb_background_scrub_data_compressed;
@@global.innodb_background_scrub_data_compressed
0
select @@session.innodb_background_scrub_data_compressed;
ERROR HY000: Variable 'innodb_background_scrub_data_compressed' is a GLOBAL variable
show global variables like 'innodb_background_scrub_data_compressed';
Variable_name Value
innodb_background_scrub_data_compressed OFF
show session variables like 'innodb_background_scrub_data_compressed';
Variable_name Value
innodb_background_scrub_data_compressed OFF
select * from information_schema.global_variables
where variable_name='innodb_background_scrub_data_compressed';
VARIABLE_NAME VARIABLE_VALUE
INNODB_BACKGROUND_SCRUB_DATA_COMPRESSED OFF
select * from information_schema.session_variables
where variable_name='innodb_background_scrub_data_compressed';
VARIABLE_NAME VARIABLE_VALUE
INNODB_BACKGROUND_SCRUB_DATA_COMPRESSED OFF
#
# show that it's writable
#
set global innodb_background_scrub_data_compressed=ON;
select @@global.innodb_background_scrub_data_compressed;
@@global.innodb_background_scrub_data_compressed
1
set global innodb_background_scrub_data_compressed=OFF;
select @@global.innodb_background_scrub_data_compressed;
@@global.innodb_background_scrub_data_compressed
0
set global innodb_background_scrub_data_compressed=1;
select @@global.innodb_background_scrub_data_compressed;
@@global.innodb_background_scrub_data_compressed
1
set session innodb_background_scrub_data_compressed=1;
ERROR HY000: Variable 'innodb_background_scrub_data_compressed' is a GLOBAL variable and should be set with SET GLOBAL
#
# incorrect types
#
set global innodb_background_scrub_data_compressed=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_compressed'
set global innodb_background_scrub_data_compressed=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_compressed'
set global innodb_background_scrub_data_compressed="foo";
ERROR 42000: Variable 'innodb_background_scrub_data_compressed' can't be set to the value of 'foo'
SET @@global.innodb_background_scrub_data_compressed = @start_global_value;
SET @start_global_value = @@global.innodb_background_scrub_data_interval;
#
# exists as global only
#
select @@global.innodb_background_scrub_data_interval;
@@global.innodb_background_scrub_data_interval
604800
select @@session.innodb_background_scrub_data_interval;
ERROR HY000: Variable 'innodb_background_scrub_data_interval' is a GLOBAL variable
show global variables like 'innodb_background_scrub_data_interval';
Variable_name Value
innodb_background_scrub_data_interval 604800
show session variables like 'innodb_background_scrub_data_interval';
Variable_name Value
innodb_background_scrub_data_interval 604800
select * from information_schema.global_variables
where variable_name='innodb_background_scrub_data_interval';
VARIABLE_NAME VARIABLE_VALUE
INNODB_BACKGROUND_SCRUB_DATA_INTERVAL 604800
select * from information_schema.session_variables
where variable_name='innodb_background_scrub_data_interval';
VARIABLE_NAME VARIABLE_VALUE
INNODB_BACKGROUND_SCRUB_DATA_INTERVAL 604800
#
# show that it's writable
#
set global innodb_background_scrub_data_interval=100;
select @@global.innodb_background_scrub_data_interval;
@@global.innodb_background_scrub_data_interval
100
set global innodb_background_scrub_data_interval=200;
select @@global.innodb_background_scrub_data_interval;
@@global.innodb_background_scrub_data_interval
200
set global innodb_background_scrub_data_interval=300;
select @@global.innodb_background_scrub_data_interval;
@@global.innodb_background_scrub_data_interval
300
set session innodb_background_scrub_data_interval=400;
ERROR HY000: Variable 'innodb_background_scrub_data_interval' is a GLOBAL variable and should be set with SET GLOBAL
#
# incorrect types
#
set global innodb_background_scrub_data_interval=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_interval'
set global innodb_background_scrub_data_interval=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_interval'
set global innodb_background_scrub_data_interval="foo";
ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_interval'
SET @@global.innodb_background_scrub_data_interval = @start_global_value;
SET @start_global_value = @@global.innodb_background_scrub_data_uncompressed;
#
# exists as global only
#
select @@global.innodb_background_scrub_data_uncompressed;
@@global.innodb_background_scrub_data_uncompressed
0
select @@session.innodb_background_scrub_data_uncompressed;
ERROR HY000: Variable 'innodb_background_scrub_data_uncompressed' is a GLOBAL variable
show global variables like 'innodb_background_scrub_data_uncompressed';
Variable_name Value
innodb_background_scrub_data_uncompressed OFF
show session variables like 'innodb_background_scrub_data_uncompressed';
Variable_name Value
innodb_background_scrub_data_uncompressed OFF
select * from information_schema.global_variables
where variable_name='innodb_background_scrub_data_uncompressed';
VARIABLE_NAME VARIABLE_VALUE
INNODB_BACKGROUND_SCRUB_DATA_UNCOMPRESSED OFF
select * from information_schema.session_variables
where variable_name='innodb_background_scrub_data_uncompressed';
VARIABLE_NAME VARIABLE_VALUE
INNODB_BACKGROUND_SCRUB_DATA_UNCOMPRESSED OFF
#
# show that it's writable
#
set global innodb_background_scrub_data_uncompressed=ON;
select @@global.innodb_background_scrub_data_uncompressed;
@@global.innodb_background_scrub_data_uncompressed
1
set global innodb_background_scrub_data_uncompressed=OFF;
select @@global.innodb_background_scrub_data_uncompressed;
@@global.innodb_background_scrub_data_uncompressed
0
set global innodb_background_scrub_data_uncompressed=1;
select @@global.innodb_background_scrub_data_uncompressed;
@@global.innodb_background_scrub_data_uncompressed
1
set session innodb_background_scrub_data_uncompressed=1;
ERROR HY000: Variable 'innodb_background_scrub_data_uncompressed' is a GLOBAL variable and should be set with SET GLOBAL
#
# incorrect types
#
set global innodb_background_scrub_data_uncompressed=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_uncompressed'
set global innodb_background_scrub_data_uncompressed=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_uncompressed'
set global innodb_background_scrub_data_uncompressed="foo";
ERROR 42000: Variable 'innodb_background_scrub_data_uncompressed' can't be set to the value of 'foo'
SET @@global.innodb_background_scrub_data_uncompressed = @start_global_value;
SELECT @start_data_encryption_filekey;
@start_data_encryption_filekey
NULL
SELECT COUNT(@@GLOBAL.innodb_data_encryption_filekey);
COUNT(@@GLOBAL.innodb_data_encryption_filekey)
0
1 Expected
SET @@GLOBAL.innodb_data_encryption_filekey='secret';
ERROR HY000: Variable 'innodb_data_encryption_filekey' is a read only variable
SELECT @start_data_encryption_providername;
@start_data_encryption_providername
NULL
SELECT COUNT(@@GLOBAL.innodb_data_encryption_providername);
COUNT(@@GLOBAL.innodb_data_encryption_providername)
0
1 Expected
SET @@GLOBAL.innodb_data_encryption_providername='key.txt';
ERROR HY000: Variable 'innodb_data_encryption_providername' is a read only variable
SELECT @start_data_encryption_providertype;
@start_data_encryption_providertype
NULL
SELECT COUNT(@@GLOBAL.innodb_data_encryption_providertype);
COUNT(@@GLOBAL.innodb_data_encryption_providertype)
1
1 Expected
SET @@GLOBAL.innodb_data_encryption_providertype=1;
ERROR HY000: Variable 'innodb_data_encryption_providertype' is a read only variable
SET @@GLOBAL.innodb_data_encryption_providertype=k;
ERROR HY000: Variable 'innodb_data_encryption_providertype' is a read only variable
SELECT @start_data_encryption_providerurl;
@start_data_encryption_providerurl
NULL
SELECT COUNT(@@GLOBAL.innodb_data_encryption_providerurl);
COUNT(@@GLOBAL.innodb_data_encryption_providerurl)
0
1 Expected
SET @@GLOBAL.innodb_data_encryption_providerurl='http://www.google.com';
ERROR HY000: Variable 'innodb_data_encryption_providerurl' is a read only variable
SELECT @@GLOBAL.innodb_encrypt_log;
@@GLOBAL.innodb_encrypt_log
0
0 Expected
SET @@GLOBAL.innodb_encrypt_log=1;
ERROR HY000: Variable 'innodb_encrypt_log' is a read only variable
Expected error 'Read only variable'
SELECT @@GLOBAL.innodb_encrypt_log;
@@GLOBAL.innodb_encrypt_log
0
0 Expected
SELECT IF(@@GLOBAL.innodb_encrypt_log, 'ON', 'OFF') = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_encrypt_log';
IF(@@GLOBAL.innodb_encrypt_log, 'ON', 'OFF') = VARIABLE_VALUE
1
1 Expected
SELECT @@GLOBAL.innodb_encrypt_log;
@@GLOBAL.innodb_encrypt_log
0
0 Expected
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_encrypt_log';
VARIABLE_VALUE
OFF
0 Expected
SELECT @@innodb_encrypt_log = @@GLOBAL.innodb_encrypt_log;
@@innodb_encrypt_log = @@GLOBAL.innodb_encrypt_log
1
1 Expected
SELECT @@innodb_encrypt_log;
@@innodb_encrypt_log
0
0 Expected
SELECT COUNT(@@local.innodb_encrypt_log);
ERROR HY000: Variable 'innodb_encrypt_log' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.innodb_encrypt_log);
ERROR HY000: Variable 'innodb_encrypt_log' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT @@GLOBAL.innodb_encrypt_log;
@@GLOBAL.innodb_encrypt_log
0
0 Expected
SELECT innodb_encrypt_log;
ERROR 42S22: Unknown column 'innodb_encrypt_log' in 'field list'
Expected error 'Unknown column in field list'
SET @start_global_value = @@global.innodb_encrypt_tables;
select @@global.innodb_encrypt_tables;
@@global.innodb_encrypt_tables
0
select @@session.innodb_encrypt_tables;
ERROR HY000: Variable 'innodb_encrypt_tables' is a GLOBAL variable
show global variables like 'innodb_encrypt_tables';
Variable_name Value
innodb_encrypt_tables OFF
show session variables like 'innodb_encrypt_tables';
Variable_name Value
innodb_encrypt_tables OFF
select * from information_schema.global_variables
where variable_name='innodb_encrypt_tables';
VARIABLE_NAME VARIABLE_VALUE
INNODB_ENCRYPT_TABLES OFF
select * from information_schema.session_variables
where variable_name='innodb_encrypt_tables';
VARIABLE_NAME VARIABLE_VALUE
INNODB_ENCRYPT_TABLES OFF
set global innodb_encrypt_tables=ON;
select @@global.innodb_encrypt_tables;
@@global.innodb_encrypt_tables
1
set global innodb_encrypt_tables=OFF;
select @@global.innodb_encrypt_tables;
@@global.innodb_encrypt_tables
0
set global innodb_encrypt_tables=1;
select @@global.innodb_encrypt_tables;
@@global.innodb_encrypt_tables
1
set session innodb_encrypt_tables=1;
ERROR HY000: Variable 'innodb_encrypt_tables' is a GLOBAL variable and should be set with SET GLOBAL
set global innodb_encrypt_tables=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_encrypt_tables'
set global innodb_encrypt_tables=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_encrypt_tables'
set global innodb_encrypt_tables="foo";
ERROR 42000: Variable 'innodb_encrypt_tables' can't be set to the value of 'foo'
SET @@global.innodb_encrypt_tables = @start_global_value;
SET @start_global_value = @@global.innodb_encryption_rotate_key_age;
select @@global.innodb_encryption_rotate_key_age;
@@global.innodb_encryption_rotate_key_age
1
select @@session.innodb_encryption_rotate_key_age;
ERROR HY000: Variable 'innodb_encryption_rotate_key_age' is a GLOBAL variable
show global variables like 'innodb_encryption_rotate_key_age';
Variable_name Value
innodb_encryption_rotate_key_age 1
show session variables like 'innodb_encryption_rotate_key_age';
Variable_name Value
innodb_encryption_rotate_key_age 1
select * from information_schema.global_variables
where variable_name='innodb_encryption_rotate_key_age';
VARIABLE_NAME VARIABLE_VALUE
INNODB_ENCRYPTION_ROTATE_KEY_AGE 1
select * from information_schema.session_variables
where variable_name='innodb_encryption_rotate_key_age';
VARIABLE_NAME VARIABLE_VALUE
INNODB_ENCRYPTION_ROTATE_KEY_AGE 1
set global innodb_encryption_rotate_key_age=1;
select @@global.innodb_encryption_rotate_key_age;
@@global.innodb_encryption_rotate_key_age
1
set global innodb_encryption_rotate_key_age=2;
select @@global.innodb_encryption_rotate_key_age;
@@global.innodb_encryption_rotate_key_age
2
set global innodb_encryption_rotate_key_age=1;
select @@global.innodb_encryption_rotate_key_age;
@@global.innodb_encryption_rotate_key_age
1
set session innodb_encryption_rotate_key_age=1;
ERROR HY000: Variable 'innodb_encryption_rotate_key_age' is a GLOBAL variable and should be set with SET GLOBAL
set global innodb_encryption_rotate_key_age=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_encryption_rotate_key_age'
set global innodb_encryption_rotate_key_age=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_encryption_rotate_key_age'
set global innodb_encryption_rotate_key_age="foo";
ERROR 42000: Incorrect argument type to variable 'innodb_encryption_rotate_key_age'
SET @@global.innodb_encryption_rotate_key_age = @start_global_value;
SET @start_global_value = @@global.innodb_encryption_rotation_iops;
select @@global.innodb_encryption_rotation_iops;
@@global.innodb_encryption_rotation_iops
100
select @@session.innodb_encryption_rotation_iops;
ERROR HY000: Variable 'innodb_encryption_rotation_iops' is a GLOBAL variable
show global variables like 'innodb_encryption_rotation_iops';
Variable_name Value
innodb_encryption_rotation_iops 100
show session variables like 'innodb_encryption_rotation_iops';
Variable_name Value
innodb_encryption_rotation_iops 100
select * from information_schema.global_variables
where variable_name='innodb_encryption_rotation_iops';
VARIABLE_NAME VARIABLE_VALUE
INNODB_ENCRYPTION_ROTATION_IOPS 100
select * from information_schema.session_variables
where variable_name='innodb_encryption_rotation_iops';
VARIABLE_NAME VARIABLE_VALUE
INNODB_ENCRYPTION_ROTATION_IOPS 100
set global innodb_encryption_rotation_iops=100;
select @@global.innodb_encryption_rotation_iops;
@@global.innodb_encryption_rotation_iops
100
set global innodb_encryption_rotation_iops=50;
select @@global.innodb_encryption_rotation_iops;
@@global.innodb_encryption_rotation_iops
50
set global innodb_encryption_rotation_iops=100;
select @@global.innodb_encryption_rotation_iops;
@@global.innodb_encryption_rotation_iops
100
set session innodb_encryption_rotation_iops=50;
ERROR HY000: Variable 'innodb_encryption_rotation_iops' is a GLOBAL variable and should be set with SET GLOBAL
set global innodb_encryption_rotation_iops=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_encryption_rotation_iops'
set global innodb_encryption_rotation_iops=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_encryption_rotation_iops'
set global innodb_encryption_rotation_iops="foo";
ERROR 42000: Incorrect argument type to variable 'innodb_encryption_rotation_iops'
SET @@global.innodb_encryption_rotation_iops = @start_global_value;
SET @start_global_value = @@global.innodb_encryption_threads;
select @@global.innodb_encryption_threads;
@@global.innodb_encryption_threads
0
select @@session.innodb_encryption_threads;
ERROR HY000: Variable 'innodb_encryption_threads' is a GLOBAL variable
show global variables like 'innodb_encryption_threads';
Variable_name Value
innodb_encryption_threads 0
show session variables like 'innodb_encryption_threads';
Variable_name Value
innodb_encryption_threads 0
select * from information_schema.global_variables
where variable_name='innodb_encryption_threads';
VARIABLE_NAME VARIABLE_VALUE
INNODB_ENCRYPTION_THREADS 0
select * from information_schema.session_variables
where variable_name='innodb_encryption_threads';
VARIABLE_NAME VARIABLE_VALUE
INNODB_ENCRYPTION_THREADS 0
set global innodb_encryption_threads=0;
select @@global.innodb_encryption_threads;
@@global.innodb_encryption_threads
0
set global innodb_encryption_threads=5;
select @@global.innodb_encryption_threads;
@@global.innodb_encryption_threads
5
set global innodb_encryption_threads=1;
select @@global.innodb_encryption_threads;
@@global.innodb_encryption_threads
1
set session innodb_encryption_threads=1;
ERROR HY000: Variable 'innodb_encryption_threads' is a GLOBAL variable and should be set with SET GLOBAL
set global innodb_encryption_threads=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_encryption_threads'
set global innodb_encryption_threads=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_encryption_threads'
set global innodb_encryption_threads="foo";
ERROR 42000: Incorrect argument type to variable 'innodb_encryption_threads'
SET @@global.innodb_encryption_threads = @start_global_value;
SET @start_global_value = @@global.innodb_immediate_scrub_data_uncompressed;
#
# exists as global only
#
select @@global.innodb_immediate_scrub_data_uncompressed;
@@global.innodb_immediate_scrub_data_uncompressed
0
select @@session.innodb_immediate_scrub_data_uncompressed;
ERROR HY000: Variable 'innodb_immediate_scrub_data_uncompressed' is a GLOBAL variable
show global variables like 'innodb_immediate_scrub_data_uncompressed';
Variable_name Value
innodb_immediate_scrub_data_uncompressed OFF
show session variables like 'innodb_immediate_scrub_data_uncompressed';
Variable_name Value
innodb_immediate_scrub_data_uncompressed OFF
select * from information_schema.global_variables
where variable_name='innodb_immediate_scrub_data_uncompressed';
VARIABLE_NAME VARIABLE_VALUE
INNODB_IMMEDIATE_SCRUB_DATA_UNCOMPRESSED OFF
select * from information_schema.session_variables
where variable_name='innodb_immediate_scrub_data_uncompressed';
VARIABLE_NAME VARIABLE_VALUE
INNODB_IMMEDIATE_SCRUB_DATA_UNCOMPRESSED OFF
#
# show that it's writable
#
set global innodb_immediate_scrub_data_uncompressed=ON;
select @@global.innodb_immediate_scrub_data_uncompressed;
@@global.innodb_immediate_scrub_data_uncompressed
1
set global innodb_immediate_scrub_data_uncompressed=OFF;
select @@global.innodb_immediate_scrub_data_uncompressed;
@@global.innodb_immediate_scrub_data_uncompressed
0
set global innodb_immediate_scrub_data_uncompressed=1;
select @@global.innodb_immediate_scrub_data_uncompressed;
@@global.innodb_immediate_scrub_data_uncompressed
1
set session innodb_immediate_scrub_data_uncompressed=1;
ERROR HY000: Variable 'innodb_immediate_scrub_data_uncompressed' is a GLOBAL variable and should be set with SET GLOBAL
#
# incorrect types
#
set global innodb_immediate_scrub_data_uncompressed=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_immediate_scrub_data_uncompressed'
set global innodb_immediate_scrub_data_uncompressed=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_immediate_scrub_data_uncompressed'
set global innodb_immediate_scrub_data_uncompressed="foo";
ERROR 42000: Variable 'innodb_immediate_scrub_data_uncompressed' can't be set to the value of 'foo'
SET @@global.innodb_immediate_scrub_data_uncompressed = @start_global_value;
...@@ -180,6 +180,9 @@ compress_page_compressed_trim_op disabled ...@@ -180,6 +180,9 @@ compress_page_compressed_trim_op disabled
compress_page_compressed_trim_op_saved disabled compress_page_compressed_trim_op_saved disabled
compress_pages_page_decompressed disabled compress_pages_page_decompressed disabled
compress_pages_page_compression_error disabled compress_pages_page_compression_error disabled
compress_pages_page_encrypted disabled
compress_pages_page_decrypted disabled
compress_pages_page_encryption_error disabled
index_page_splits disabled index_page_splits disabled
index_page_merge_attempts disabled index_page_merge_attempts disabled
index_page_merge_successful disabled index_page_merge_successful disabled
......
...@@ -180,6 +180,9 @@ compress_page_compressed_trim_op disabled ...@@ -180,6 +180,9 @@ compress_page_compressed_trim_op disabled
compress_page_compressed_trim_op_saved disabled compress_page_compressed_trim_op_saved disabled
compress_pages_page_decompressed disabled compress_pages_page_decompressed disabled
compress_pages_page_compression_error disabled compress_pages_page_compression_error disabled
compress_pages_page_encrypted disabled
compress_pages_page_decrypted disabled
compress_pages_page_encryption_error disabled
index_page_splits disabled index_page_splits disabled
index_page_merge_attempts disabled index_page_merge_attempts disabled
index_page_merge_successful disabled index_page_merge_successful disabled
......
...@@ -180,6 +180,9 @@ compress_page_compressed_trim_op disabled ...@@ -180,6 +180,9 @@ compress_page_compressed_trim_op disabled
compress_page_compressed_trim_op_saved disabled compress_page_compressed_trim_op_saved disabled
compress_pages_page_decompressed disabled compress_pages_page_decompressed disabled
compress_pages_page_compression_error disabled compress_pages_page_compression_error disabled
compress_pages_page_encrypted disabled
compress_pages_page_decrypted disabled
compress_pages_page_encryption_error disabled
index_page_splits disabled index_page_splits disabled
index_page_merge_attempts disabled index_page_merge_attempts disabled
index_page_merge_successful disabled index_page_merge_successful disabled
......
...@@ -180,6 +180,9 @@ compress_page_compressed_trim_op disabled ...@@ -180,6 +180,9 @@ compress_page_compressed_trim_op disabled
compress_page_compressed_trim_op_saved disabled compress_page_compressed_trim_op_saved disabled
compress_pages_page_decompressed disabled compress_pages_page_decompressed disabled
compress_pages_page_compression_error disabled compress_pages_page_compression_error disabled
compress_pages_page_encrypted disabled
compress_pages_page_decrypted disabled
compress_pages_page_encryption_error disabled
index_page_splits disabled index_page_splits disabled
index_page_merge_attempts disabled index_page_merge_attempts disabled
index_page_merge_successful disabled index_page_merge_successful disabled
......
SET @start_global_value = @@global.innodb_scrub_force_testing;
#
# exists as global only
#
select @@global.innodb_scrub_force_testing;
@@global.innodb_scrub_force_testing
0
select @@session.innodb_scrub_force_testing;
ERROR HY000: Variable 'innodb_scrub_force_testing' is a GLOBAL variable
show global variables like 'innodb_scrub_force_testing';
Variable_name Value
innodb_scrub_force_testing OFF
show session variables like 'innodb_scrub_force_testing';
Variable_name Value
innodb_scrub_force_testing OFF
select * from information_schema.global_variables
where variable_name='innodb_scrub_force_testing';
VARIABLE_NAME VARIABLE_VALUE
INNODB_SCRUB_FORCE_TESTING OFF
select * from information_schema.session_variables
where variable_name='innodb_scrub_force_testing';
VARIABLE_NAME VARIABLE_VALUE
INNODB_SCRUB_FORCE_TESTING OFF
#
# show that it's writable
#
set global innodb_scrub_force_testing=ON;
select @@global.innodb_scrub_force_testing;
@@global.innodb_scrub_force_testing
1
set global innodb_scrub_force_testing=OFF;
select @@global.innodb_scrub_force_testing;
@@global.innodb_scrub_force_testing
0
set global innodb_scrub_force_testing=1;
select @@global.innodb_scrub_force_testing;
@@global.innodb_scrub_force_testing
1
set session innodb_scrub_force_testing=1;
ERROR HY000: Variable 'innodb_scrub_force_testing' is a GLOBAL variable and should be set with SET GLOBAL
#
# incorrect types
#
set global innodb_scrub_force_testing=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_scrub_force_testing'
set global innodb_scrub_force_testing=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_scrub_force_testing'
set global innodb_scrub_force_testing="foo";
ERROR 42000: Variable 'innodb_scrub_force_testing' can't be set to the value of 'foo'
SET @@global.innodb_scrub_force_testing = @start_global_value;
SELECT @@GLOBAL.innodb_scrub_log;
@@GLOBAL.innodb_scrub_log
0
0 Expected
SET @@GLOBAL.innodb_scrub_log=1;
ERROR HY000: Variable 'innodb_scrub_log' is a read only variable
Expected error 'Read only variable'
SELECT @@GLOBAL.innodb_scrub_log;
@@GLOBAL.innodb_scrub_log
0
0 Expected
SELECT IF(@@GLOBAL.innodb_scrub_log, 'ON', 'OFF') = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_scrub_log';
IF(@@GLOBAL.innodb_scrub_log, 'ON', 'OFF') = VARIABLE_VALUE
1
1 Expected
SELECT @@GLOBAL.innodb_scrub_log;
@@GLOBAL.innodb_scrub_log
0
0 Expected
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_scrub_log';
VARIABLE_VALUE
OFF
0 Expected
SELECT @@innodb_scrub_log = @@GLOBAL.innodb_scrub_log;
@@innodb_scrub_log = @@GLOBAL.innodb_scrub_log
1
1 Expected
SELECT @@innodb_scrub_log;
@@innodb_scrub_log
0
0 Expected
SELECT @@local.innodb_scrub_log;
ERROR HY000: Variable 'innodb_scrub_log' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT @@SESSION.innodb_scrub_log;
ERROR HY000: Variable 'innodb_scrub_log' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT @@GLOBAL.innodb_scrub_log;
@@GLOBAL.innodb_scrub_log
0
0 Expected
SELECT innodb_scrub_log;
ERROR 42S22: Unknown column 'innodb_scrub_log' in 'field list'
Expected error 'Unknow column in field list'
SELECT @@GLOBAL.innodb_scrub_log_interval;
@@GLOBAL.innodb_scrub_log_interval
2000
200 Expected
SET @@GLOBAL.innodb_scrub_log_interval=100;
1 Expected
SELECT @@GLOBAL.innodb_scrub_log_interval;
@@GLOBAL.innodb_scrub_log_interval
100
100 Expected
SET @@GLOBAL.innodb_scrub_log_interval=DEFAULT;
1 Expected
SELECT @@GLOBAL.innodb_scrub_log_interval;
@@GLOBAL.innodb_scrub_log_interval
2000
200 Expected
SELECT @@GLOBAL.innodb_scrub_log_interval = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_scrub_log_interval';
@@GLOBAL.innodb_scrub_log_interval = VARIABLE_VALUE
1
1 Expected
SELECT @@GLOBAL.innodb_scrub_log_interval;
@@GLOBAL.innodb_scrub_log_interval
2000
200 Expected
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_scrub_log_interval';
VARIABLE_VALUE
2000
200 Expected
SELECT @@innodb_scrub_log_interval = @@GLOBAL.innodb_scrub_log_interval;
@@innodb_scrub_log_interval = @@GLOBAL.innodb_scrub_log_interval
1
1 Expected
SELECT @@innodb_scrub_log_interval;
@@innodb_scrub_log_interval
2000
200 Expected
SELECT @@local.innodb_scrub_log_interval;
ERROR HY000: Variable 'innodb_scrub_log_interval' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT @@SESSION.innodb_scrub_log_interval;
ERROR HY000: Variable 'innodb_scrub_log_interval' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT @@GLOBAL.innodb_scrub_log_interval;
@@GLOBAL.innodb_scrub_log_interval
2000
200 Expected
SELECT innodb_scrub_log_interval;
ERROR 42S22: Unknown column 'innodb_scrub_log_interval' in 'field list'
Expected error 'Unknow column in field list'
...@@ -43,6 +43,20 @@ NUMERIC_BLOCK_SIZE 1 ...@@ -43,6 +43,20 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_ENCRYPT_TABLES
SESSION_VALUE NULL
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Encrypt tables (only for tables with ROW_FORMAT=PAGE (default) and not FIXED/DYNAMIC)
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_FORCE_START_AFTER_RECOVERY_FAILURES VARIABLE_NAME ARIA_FORCE_START_AFTER_RECOVERY_FAILURES
SESSION_VALUE NULL SESSION_VALUE NULL
GLOBAL_VALUE 0 GLOBAL_VALUE 0
......
...@@ -57,6 +57,20 @@ NUMERIC_BLOCK_SIZE NULL ...@@ -57,6 +57,20 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME DEBUG_ENCRYPTION_KEY_VERSION
SESSION_VALUE NULL
GLOBAL_VALUE 0
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Encryption key version. Only to be used in internal testing.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEBUG_MUTEX_DEADLOCK_DETECTOR VARIABLE_NAME DEBUG_MUTEX_DEADLOCK_DETECTOR
SESSION_VALUE NULL SESSION_VALUE NULL
GLOBAL_VALUE ON GLOBAL_VALUE ON
...@@ -99,3 +113,17 @@ NUMERIC_BLOCK_SIZE NULL ...@@ -99,3 +113,17 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME DEBUG_USE_STATIC_ENCRYPTION_KEYS
SESSION_VALUE NULL
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Enable use of nonrandom encryption keys. Only to be used in internal testing
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
...@@ -173,6 +173,62 @@ NUMERIC_BLOCK_SIZE 0 ...@@ -173,6 +173,62 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY YES READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_BACKGROUND_SCRUB_DATA_CHECK_INTERVAL
SESSION_VALUE NULL
GLOBAL_VALUE 3600
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 3600
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT check if spaces needs scrubbing every innodb_background_scrub_data_check_interval seconds
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_BACKGROUND_SCRUB_DATA_COMPRESSED
SESSION_VALUE NULL
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Enable scrubbing of compressed data by background threads (same as encryption_threads)
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_BACKGROUND_SCRUB_DATA_INTERVAL
SESSION_VALUE NULL
GLOBAL_VALUE 604800
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 604800
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT scrub spaces that were last scrubbed longer than innodb_background_scrub_data_interval seconds ago
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_BACKGROUND_SCRUB_DATA_UNCOMPRESSED
SESSION_VALUE NULL
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Enable scrubbing of uncompressed data by background threads (same as encryption_threads)
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_BUFFER_POOL_DUMP_AT_SHUTDOWN VARIABLE_NAME INNODB_BUFFER_POOL_DUMP_AT_SHUTDOWN
SESSION_VALUE NULL SESSION_VALUE NULL
GLOBAL_VALUE OFF GLOBAL_VALUE OFF
...@@ -649,6 +705,76 @@ NUMERIC_BLOCK_SIZE 0 ...@@ -649,6 +705,76 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY YES READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_ENCRYPTION_ROTATE_KEY_AGE
SESSION_VALUE NULL
GLOBAL_VALUE 1
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Rotate any page having a key older than this
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_ENCRYPTION_ROTATION_IOPS
SESSION_VALUE NULL
GLOBAL_VALUE 100
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 100
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Use this many iops for background key rotation
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_ENCRYPTION_THREADS
SESSION_VALUE NULL
GLOBAL_VALUE 0
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT No of threads performing background key rotation and scrubbing
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_ENCRYPT_LOG
SESSION_VALUE NULL
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Enable redo log encryption/decryption.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_ENCRYPT_TABLES
SESSION_VALUE NULL
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Encrypt all tables in the storage engine
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_FAST_SHUTDOWN VARIABLE_NAME INNODB_FAST_SHUTDOWN
SESSION_VALUE NULL SESSION_VALUE NULL
GLOBAL_VALUE 1 GLOBAL_VALUE 1
...@@ -1055,6 +1181,20 @@ NUMERIC_BLOCK_SIZE 0 ...@@ -1055,6 +1181,20 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_IMMEDIATE_SCRUB_DATA_UNCOMPRESSED
SESSION_VALUE NULL
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Enable scrubbing of data
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_IO_CAPACITY VARIABLE_NAME INNODB_IO_CAPACITY
SESSION_VALUE NULL SESSION_VALUE NULL
GLOBAL_VALUE 200 GLOBAL_VALUE 200
...@@ -1671,6 +1811,48 @@ NUMERIC_BLOCK_SIZE 0 ...@@ -1671,6 +1811,48 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_SCRUB_FORCE_TESTING
SESSION_VALUE NULL
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Perform extra scrubbing to increase test exposure
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_SCRUB_LOG
SESSION_VALUE NULL
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Enable redo log scrubbing
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_SCRUB_LOG_INTERVAL
SESSION_VALUE NULL
GLOBAL_VALUE 2000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 2000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Innodb redo log scrubbing interval in ms
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 18446744073709551615
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_SIMULATE_COMP_FAILURES VARIABLE_NAME INNODB_SIMULATE_COMP_FAILURES
SESSION_VALUE NULL SESSION_VALUE NULL
GLOBAL_VALUE 0 GLOBAL_VALUE 0
......
...@@ -679,6 +679,34 @@ NUMERIC_BLOCK_SIZE 1 ...@@ -679,6 +679,34 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ENCRYPTION_ALGORITHM
SESSION_VALUE NULL
GLOBAL_VALUE none
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE none
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE ENUM
VARIABLE_COMMENT Which encryption algorithm to use for table encryption. aes_cbc is the recommended one.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST none,aes_ecb,aes_cbc,aes_ctr
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ENCRYPT_TMP_DISK_TABLES
SESSION_VALUE NULL
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Encrypt tmp disk tables (created as part of query execution)
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ERROR_COUNT VARIABLE_NAME ERROR_COUNT
SESSION_VALUE 0 SESSION_VALUE 0
GLOBAL_VALUE NULL GLOBAL_VALUE NULL
......
...@@ -693,6 +693,34 @@ NUMERIC_BLOCK_SIZE 1 ...@@ -693,6 +693,34 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ENCRYPTION_ALGORITHM
SESSION_VALUE NULL
GLOBAL_VALUE none
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE none
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE ENUM
VARIABLE_COMMENT Which encryption algorithm to use for table encryption. aes_cbc is the recommended one.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST none,aes_ecb,aes_cbc,aes_ctr
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ENCRYPT_TMP_DISK_TABLES
SESSION_VALUE NULL
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Encrypt tmp disk tables (created as part of query execution)
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ERROR_COUNT VARIABLE_NAME ERROR_COUNT
SESSION_VALUE 0 SESSION_VALUE 0
GLOBAL_VALUE NULL GLOBAL_VALUE NULL
......
# bool global
--source include/have_maria.inc
SET @start_global_value = @@global.aria_encrypt_tables;
#
# exists as global only
#
select @@global.aria_encrypt_tables;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.aria_encrypt_tables;
show global variables like 'aria_encrypt_tables';
show session variables like 'aria_encrypt_tables';
select * from information_schema.global_variables
where variable_name='aria_encrypt_tables';
select * from information_schema.session_variables
where variable_name='aria_encrypt_tables';
#
# show that it's writable
#
set global aria_encrypt_tables=ON;
select @@global.aria_encrypt_tables;
set global aria_encrypt_tables=OFF;
select @@global.aria_encrypt_tables;
set global aria_encrypt_tables=1;
select @@global.aria_encrypt_tables;
--error ER_GLOBAL_VARIABLE
set session aria_encrypt_tables=1;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global aria_encrypt_tables=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global aria_encrypt_tables=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global aria_encrypt_tables="foo";
SET @@global.aria_encrypt_tables = @start_global_value;
--source include/have_debug.inc
# This is just to satisfy all_vars
select 1;
# This is just to satisfy all_vars
--source include/have_debug.inc
show global variables like "debug_use_static_encryption_keys";
# bool global
--source include/have_maria.inc
SET @start_global_value = @@global.encrypt_tmp_disk_tables;
#
# exists as global only
#
select @@global.encrypt_tmp_disk_tables;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.encrypt_tmp_disk_tables;
show global variables like 'encrypt_tmp_disk_tables';
show session variables like 'encrypt_tmp_disk_tables';
select * from information_schema.global_variables
where variable_name='encrypt_tmp_disk_tables';
select * from information_schema.session_variables
where variable_name='encrypt_tmp_disk_tables';
#
# show that it's writable
#
set global encrypt_tmp_disk_tables=ON;
select @@global.encrypt_tmp_disk_tables;
set global encrypt_tmp_disk_tables=OFF;
select @@global.encrypt_tmp_disk_tables;
set global encrypt_tmp_disk_tables=1;
select @@global.encrypt_tmp_disk_tables;
--error ER_GLOBAL_VARIABLE
set session encrypt_tmp_disk_tables=1;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global encrypt_tmp_disk_tables=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global encrypt_tmp_disk_tables=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global encrypt_tmp_disk_tables="foo";
SET @@global.encrypt_tmp_disk_tables = @start_global_value;
# bool global
# exists as global only
#
select @@global.encryption_algorithm;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.encryption_algorithm;
#
# show that it's not writable
#
--error 1238
set global encryption_algorithm="none";
# bool global
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_background_scrub_data_check_interval;
--echo #
--echo # default value
--echo #
select @@global.innodb_background_scrub_data_check_interval;
set global innodb_background_scrub_data_check_interval=10;
select @@global.innodb_background_scrub_data_check_interval;
set global innodb_background_scrub_data_check_interval=DEFAULT;
select @@global.innodb_background_scrub_data_check_interval;
set global innodb_background_scrub_data_check_interval=20;
select @@global.innodb_background_scrub_data_check_interval;
set global innodb_background_scrub_data_check_interval=DEFAULT;
select @@global.innodb_background_scrub_data_check_interval;
--echo #
--echo # exists as global only
--echo #
select @@global.innodb_background_scrub_data_check_interval;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_background_scrub_data_check_interval;
show global variables like 'innodb_background_scrub_data_check_interval';
show session variables like 'innodb_background_scrub_data_check_interval';
select * from information_schema.global_variables
where variable_name='innodb_background_scrub_data_check_interval';
select * from information_schema.session_variables
where variable_name='innodb_background_scrub_data_check_interval';
--echo #
--echo # show that it's writable
--echo #
set global innodb_background_scrub_data_check_interval=10;
select @@global.innodb_background_scrub_data_check_interval;
set global innodb_background_scrub_data_check_interval=20;
select @@global.innodb_background_scrub_data_check_interval;
set global innodb_background_scrub_data_check_interval=1;
select @@global.innodb_background_scrub_data_check_interval;
--error ER_GLOBAL_VARIABLE
set session innodb_background_scrub_data_check_interval=1;
--echo #
--echo # incorrect types
--echo #
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_background_scrub_data_check_interval=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_background_scrub_data_check_interval=1e1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_background_scrub_data_check_interval="foo";
SET @@global.innodb_background_scrub_data_check_interval = @start_global_value;
# bool global
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_background_scrub_data_compressed;
--echo #
--echo # exists as global only
--echo #
select @@global.innodb_background_scrub_data_compressed;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_background_scrub_data_compressed;
show global variables like 'innodb_background_scrub_data_compressed';
show session variables like 'innodb_background_scrub_data_compressed';
select * from information_schema.global_variables
where variable_name='innodb_background_scrub_data_compressed';
select * from information_schema.session_variables
where variable_name='innodb_background_scrub_data_compressed';
--echo #
--echo # show that it's writable
--echo #
set global innodb_background_scrub_data_compressed=ON;
select @@global.innodb_background_scrub_data_compressed;
set global innodb_background_scrub_data_compressed=OFF;
select @@global.innodb_background_scrub_data_compressed;
set global innodb_background_scrub_data_compressed=1;
select @@global.innodb_background_scrub_data_compressed;
--error ER_GLOBAL_VARIABLE
set session innodb_background_scrub_data_compressed=1;
--echo #
--echo # incorrect types
--echo #
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_background_scrub_data_compressed=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_background_scrub_data_compressed=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_background_scrub_data_compressed="foo";
SET @@global.innodb_background_scrub_data_compressed = @start_global_value;
# bool global
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_background_scrub_data_interval;
--echo #
--echo # exists as global only
--echo #
select @@global.innodb_background_scrub_data_interval;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_background_scrub_data_interval;
show global variables like 'innodb_background_scrub_data_interval';
show session variables like 'innodb_background_scrub_data_interval';
select * from information_schema.global_variables
where variable_name='innodb_background_scrub_data_interval';
select * from information_schema.session_variables
where variable_name='innodb_background_scrub_data_interval';
--echo #
--echo # show that it's writable
--echo #
set global innodb_background_scrub_data_interval=100;
select @@global.innodb_background_scrub_data_interval;
set global innodb_background_scrub_data_interval=200;
select @@global.innodb_background_scrub_data_interval;
set global innodb_background_scrub_data_interval=300;
select @@global.innodb_background_scrub_data_interval;
--error ER_GLOBAL_VARIABLE
set session innodb_background_scrub_data_interval=400;
--echo #
--echo # incorrect types
--echo #
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_background_scrub_data_interval=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_background_scrub_data_interval=1e1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_background_scrub_data_interval="foo";
SET @@global.innodb_background_scrub_data_interval = @start_global_value;
# bool global
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_background_scrub_data_uncompressed;
--echo #
--echo # exists as global only
--echo #
select @@global.innodb_background_scrub_data_uncompressed;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_background_scrub_data_uncompressed;
show global variables like 'innodb_background_scrub_data_uncompressed';
show session variables like 'innodb_background_scrub_data_uncompressed';
select * from information_schema.global_variables
where variable_name='innodb_background_scrub_data_uncompressed';
select * from information_schema.session_variables
where variable_name='innodb_background_scrub_data_uncompressed';
--echo #
--echo # show that it's writable
--echo #
set global innodb_background_scrub_data_uncompressed=ON;
select @@global.innodb_background_scrub_data_uncompressed;
set global innodb_background_scrub_data_uncompressed=OFF;
select @@global.innodb_background_scrub_data_uncompressed;
set global innodb_background_scrub_data_uncompressed=1;
select @@global.innodb_background_scrub_data_uncompressed;
--error ER_GLOBAL_VARIABLE
set session innodb_background_scrub_data_uncompressed=1;
--echo #
--echo # incorrect types
--echo #
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_background_scrub_data_uncompressed=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_background_scrub_data_uncompressed=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_background_scrub_data_uncompressed="foo";
SET @@global.innodb_background_scrub_data_uncompressed = @start_global_value;
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/not_encrypted.inc
# Check the default value # Check the default value
SET @orig = @@global.innodb_checksum_algorithm; SET @orig = @@global.innodb_checksum_algorithm;
......
--source include/have_innodb.inc
--source include/have_innodb_encryption.inc
SELECT @start_data_encryption_filekey;
SELECT COUNT(@@GLOBAL.innodb_data_encryption_filekey);
--echo 1 Expected
# This variable is read only variable
--error 1238
SET @@GLOBAL.innodb_data_encryption_filekey='secret';
--source include/have_innodb.inc
--source include/have_innodb_encryption.inc
SELECT @start_data_encryption_providername;
SELECT COUNT(@@GLOBAL.innodb_data_encryption_providername);
--echo 1 Expected
# This variable is read only variable
--error 1238
SET @@GLOBAL.innodb_data_encryption_providername='key.txt';
--source include/have_innodb.inc
--source include/have_innodb_encryption.inc
SELECT @start_data_encryption_providertype;
SELECT COUNT(@@GLOBAL.innodb_data_encryption_providertype);
--echo 1 Expected
# This variable is read only variable
--error 1238
SET @@GLOBAL.innodb_data_encryption_providertype=1;
# This variable is read only variable
--error 1238
SET @@GLOBAL.innodb_data_encryption_providertype=k;
--source include/have_innodb.inc
--source include/have_innodb_encryption.inc
SELECT @start_data_encryption_providerurl;
SELECT COUNT(@@GLOBAL.innodb_data_encryption_providerurl);
--echo 1 Expected
# This variable is read only variable
--error 1238
SET @@GLOBAL.innodb_data_encryption_providerurl='http://www.google.com';
--source include/have_innodb.inc
# Display default value
SELECT @@GLOBAL.innodb_encrypt_log;
--echo 0 Expected
# Check if value can be set
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@GLOBAL.innodb_encrypt_log=1;
--echo Expected error 'Read only variable'
SELECT @@GLOBAL.innodb_encrypt_log;
--echo 0 Expected
# Check if the value in GLOBAL TABLE matches value in variable
SELECT IF(@@GLOBAL.innodb_encrypt_log, 'ON', 'OFF') = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_encrypt_log';
--echo 1 Expected
SELECT @@GLOBAL.innodb_encrypt_log;
--echo 0 Expected
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_encrypt_log';
--echo 0 Expected
# Check if accessing variable with and without GLOBAL point to same variable
SELECT @@innodb_encrypt_log = @@GLOBAL.innodb_encrypt_log;
--echo 1 Expected
# Check if innodb_encrypt_log can be accessed with and without @@ sign
SELECT @@innodb_encrypt_log;
--echo 0 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.innodb_encrypt_log);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.innodb_encrypt_log);
--echo Expected error 'Variable is a GLOBAL variable'
SELECT @@GLOBAL.innodb_encrypt_log;
--echo 0 Expected
--Error ER_BAD_FIELD_ERROR
SELECT innodb_encrypt_log;
--echo Expected error 'Unknown column in field list'
# bool global
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_encrypt_tables;
#
# exists as global only
#
select @@global.innodb_encrypt_tables;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_encrypt_tables;
show global variables like 'innodb_encrypt_tables';
show session variables like 'innodb_encrypt_tables';
select * from information_schema.global_variables
where variable_name='innodb_encrypt_tables';
select * from information_schema.session_variables
where variable_name='innodb_encrypt_tables';
#
# show that it's writable
#
set global innodb_encrypt_tables=ON;
select @@global.innodb_encrypt_tables;
set global innodb_encrypt_tables=OFF;
select @@global.innodb_encrypt_tables;
set global innodb_encrypt_tables=1;
select @@global.innodb_encrypt_tables;
--error ER_GLOBAL_VARIABLE
set session innodb_encrypt_tables=1;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_encrypt_tables=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_encrypt_tables=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_encrypt_tables="foo";
SET @@global.innodb_encrypt_tables = @start_global_value;
# bool global
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_encryption_rotate_key_age;
#
# exists as global only
#
select @@global.innodb_encryption_rotate_key_age;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_encryption_rotate_key_age;
show global variables like 'innodb_encryption_rotate_key_age';
show session variables like 'innodb_encryption_rotate_key_age';
select * from information_schema.global_variables
where variable_name='innodb_encryption_rotate_key_age';
select * from information_schema.session_variables
where variable_name='innodb_encryption_rotate_key_age';
#
# show that it's writable
#
set global innodb_encryption_rotate_key_age=1;
select @@global.innodb_encryption_rotate_key_age;
set global innodb_encryption_rotate_key_age=2;
select @@global.innodb_encryption_rotate_key_age;
set global innodb_encryption_rotate_key_age=1;
select @@global.innodb_encryption_rotate_key_age;
--error ER_GLOBAL_VARIABLE
set session innodb_encryption_rotate_key_age=1;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_encryption_rotate_key_age=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_encryption_rotate_key_age=1e1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_encryption_rotate_key_age="foo";
SET @@global.innodb_encryption_rotate_key_age = @start_global_value;
# bool global
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_encryption_rotation_iops;
#
# exists as global only
#
select @@global.innodb_encryption_rotation_iops;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_encryption_rotation_iops;
show global variables like 'innodb_encryption_rotation_iops';
show session variables like 'innodb_encryption_rotation_iops';
select * from information_schema.global_variables
where variable_name='innodb_encryption_rotation_iops';
select * from information_schema.session_variables
where variable_name='innodb_encryption_rotation_iops';
#
# show that it's writable
#
set global innodb_encryption_rotation_iops=100;
select @@global.innodb_encryption_rotation_iops;
set global innodb_encryption_rotation_iops=50;
select @@global.innodb_encryption_rotation_iops;
set global innodb_encryption_rotation_iops=100;
select @@global.innodb_encryption_rotation_iops;
--error ER_GLOBAL_VARIABLE
set session innodb_encryption_rotation_iops=50;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_encryption_rotation_iops=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_encryption_rotation_iops=1e1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_encryption_rotation_iops="foo";
SET @@global.innodb_encryption_rotation_iops = @start_global_value;
# bool global
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_encryption_threads;
#
# exists as global only
#
select @@global.innodb_encryption_threads;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_encryption_threads;
show global variables like 'innodb_encryption_threads';
show session variables like 'innodb_encryption_threads';
select * from information_schema.global_variables
where variable_name='innodb_encryption_threads';
select * from information_schema.session_variables
where variable_name='innodb_encryption_threads';
#
# show that it's writable
#
set global innodb_encryption_threads=0;
select @@global.innodb_encryption_threads;
set global innodb_encryption_threads=5;
select @@global.innodb_encryption_threads;
set global innodb_encryption_threads=1;
select @@global.innodb_encryption_threads;
--error ER_GLOBAL_VARIABLE
set session innodb_encryption_threads=1;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_encryption_threads=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_encryption_threads=1e1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_encryption_threads="foo";
SET @@global.innodb_encryption_threads = @start_global_value;
# bool global
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_immediate_scrub_data_uncompressed;
--echo #
--echo # exists as global only
--echo #
select @@global.innodb_immediate_scrub_data_uncompressed;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_immediate_scrub_data_uncompressed;
show global variables like 'innodb_immediate_scrub_data_uncompressed';
show session variables like 'innodb_immediate_scrub_data_uncompressed';
select * from information_schema.global_variables
where variable_name='innodb_immediate_scrub_data_uncompressed';
select * from information_schema.session_variables
where variable_name='innodb_immediate_scrub_data_uncompressed';
--echo #
--echo # show that it's writable
--echo #
set global innodb_immediate_scrub_data_uncompressed=ON;
select @@global.innodb_immediate_scrub_data_uncompressed;
set global innodb_immediate_scrub_data_uncompressed=OFF;
select @@global.innodb_immediate_scrub_data_uncompressed;
set global innodb_immediate_scrub_data_uncompressed=1;
select @@global.innodb_immediate_scrub_data_uncompressed;
--error ER_GLOBAL_VARIABLE
set session innodb_immediate_scrub_data_uncompressed=1;
--echo #
--echo # incorrect types
--echo #
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_immediate_scrub_data_uncompressed=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_immediate_scrub_data_uncompressed=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_immediate_scrub_data_uncompressed="foo";
SET @@global.innodb_immediate_scrub_data_uncompressed = @start_global_value;
# bool global
--source include/have_innodb.inc
--source include/have_debug.inc
SET @start_global_value = @@global.innodb_scrub_force_testing;
--echo #
--echo # exists as global only
--echo #
select @@global.innodb_scrub_force_testing;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_scrub_force_testing;
show global variables like 'innodb_scrub_force_testing';
show session variables like 'innodb_scrub_force_testing';
select * from information_schema.global_variables
where variable_name='innodb_scrub_force_testing';
select * from information_schema.session_variables
where variable_name='innodb_scrub_force_testing';
--echo #
--echo # show that it's writable
--echo #
set global innodb_scrub_force_testing=ON;
select @@global.innodb_scrub_force_testing;
set global innodb_scrub_force_testing=OFF;
select @@global.innodb_scrub_force_testing;
set global innodb_scrub_force_testing=1;
select @@global.innodb_scrub_force_testing;
--error ER_GLOBAL_VARIABLE
set session innodb_scrub_force_testing=1;
--echo #
--echo # incorrect types
--echo #
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_scrub_force_testing=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_scrub_force_testing=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_scrub_force_testing="foo";
SET @@global.innodb_scrub_force_testing = @start_global_value;
--source include/have_innodb.inc
# Display default value
SELECT @@GLOBAL.innodb_scrub_log;
--echo 0 Expected
# Check if value can be set
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@GLOBAL.innodb_scrub_log=1;
--echo Expected error 'Read only variable'
SELECT @@GLOBAL.innodb_scrub_log;
--echo 0 Expected
# Check if the value in GLOBAL TABLE matches value in variable
SELECT IF(@@GLOBAL.innodb_scrub_log, 'ON', 'OFF') = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_scrub_log';
--echo 1 Expected
SELECT @@GLOBAL.innodb_scrub_log;
--echo 0 Expected
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_scrub_log';
--echo 0 Expected
# Check if accessing variable with and without GLOBAL point to same variable
SELECT @@innodb_scrub_log = @@GLOBAL.innodb_scrub_log;
--echo 1 Expected
# Check if innodb_scrub_log can be accessed with and without @@ sign
SELECT @@innodb_scrub_log;
--echo 0 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@local.innodb_scrub_log;
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@SESSION.innodb_scrub_log;
--echo Expected error 'Variable is a GLOBAL variable'
SELECT @@GLOBAL.innodb_scrub_log;
--echo 0 Expected
--Error ER_BAD_FIELD_ERROR
SELECT innodb_scrub_log;
--echo Expected error 'Unknow column in field list'
--source include/have_innodb.inc
# Display default value
SELECT @@GLOBAL.innodb_scrub_log_interval;
--echo 200 Expected
# Check if value can be set
SET @@GLOBAL.innodb_scrub_log_interval=100;
--echo 1 Expected
SELECT @@GLOBAL.innodb_scrub_log_interval;
--echo 100 Expected
SET @@GLOBAL.innodb_scrub_log_interval=DEFAULT;
--echo 1 Expected
SELECT @@GLOBAL.innodb_scrub_log_interval;
--echo 200 Expected
# Check if the value in GLOBAL TABLE matches value in variable
SELECT @@GLOBAL.innodb_scrub_log_interval = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_scrub_log_interval';
--echo 1 Expected
SELECT @@GLOBAL.innodb_scrub_log_interval;
--echo 200 Expected
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_scrub_log_interval';
--echo 200 Expected
# Check if accessing variable with and without GLOBAL point to same variable
SELECT @@innodb_scrub_log_interval = @@GLOBAL.innodb_scrub_log_interval;
--echo 1 Expected
# Check if innodb_scrub_log_interval can be accessed with and without @@ sign
SELECT @@innodb_scrub_log_interval;
--echo 200 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@local.innodb_scrub_log_interval;
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@SESSION.innodb_scrub_log_interval;
--echo Expected error 'Variable is a GLOBAL variable'
SELECT @@GLOBAL.innodb_scrub_log_interval;
--echo 200 Expected
--Error ER_BAD_FIELD_ERROR
SELECT innodb_scrub_log_interval;
--echo Expected error 'Unknow column in field list'
...@@ -13,3 +13,5 @@ ...@@ -13,3 +13,5 @@
--loose-innodb-sys-foreign-cols --loose-innodb-sys-foreign-cols
--loose-innodb-sys-tables --loose-innodb-sys-tables
--loose-innodb-sys-tablestats --loose-innodb-sys-tablestats
--loose-innodb-tablespaces-encryption
--loose-innodb-tablespaces-scrubbing
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment