Commit 771dec39 authored by Sergei Petrunia's avatar Sergei Petrunia

Merge branch '10.1' into bb-10.1-explain-analyze

parents 0719df78 d214c83b
...@@ -230,7 +230,6 @@ MARK_AS_ADVANCED(WITH_FAST_MUTEXES) ...@@ -230,7 +230,6 @@ MARK_AS_ADVANCED(WITH_FAST_MUTEXES)
OPTION(WITH_INNODB_DISALLOW_WRITES "InnoDB freeze writes patch from Google" ${WITH_WSREP}) OPTION(WITH_INNODB_DISALLOW_WRITES "InnoDB freeze writes patch from Google" ${WITH_WSREP})
IF (WITH_INNODB_DISALLOW_WRITES) IF (WITH_INNODB_DISALLOW_WRITES)
MESSAGE(STATUS "INNODB_DISALLOW_WRITES")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWITH_INNODB_DISALLOW_WRITES") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWITH_INNODB_DISALLOW_WRITES")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_INNODB_DISALLOW_WRITES") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_INNODB_DISALLOW_WRITES")
ENDIF() ENDIF()
......
...@@ -44,7 +44,7 @@ IF(CMAKE_COMPILER_IS_GNUCC AND RUN_ABI_CHECK) ...@@ -44,7 +44,7 @@ IF(CMAKE_COMPILER_IS_GNUCC AND RUN_ABI_CHECK)
${CMAKE_SOURCE_DIR}/include/mysql/client_plugin.h ${CMAKE_SOURCE_DIR}/include/mysql/client_plugin.h
${CMAKE_SOURCE_DIR}/include/mysql/plugin_auth.h ${CMAKE_SOURCE_DIR}/include/mysql/plugin_auth.h
${CMAKE_SOURCE_DIR}/include/mysql/plugin_password_validation.h ${CMAKE_SOURCE_DIR}/include/mysql/plugin_password_validation.h
${CMAKE_SOURCE_DIR}/include/mysql/plugin_encryption_key_management.h ${CMAKE_SOURCE_DIR}/include/mysql/plugin_encryption.h
) )
ADD_CUSTOM_TARGET(abi_check ALL ADD_CUSTOM_TARGET(abi_check ALL
......
...@@ -37,16 +37,16 @@ FUNCTION(MY_CHECK_AND_SET_COMPILER_FLAG flag) ...@@ -37,16 +37,16 @@ FUNCTION(MY_CHECK_AND_SET_COMPILER_FLAG flag)
ENDIF() ENDIF()
MY_CHECK_C_COMPILER_FLAG(${flag} HAVE_C_${flag}) MY_CHECK_C_COMPILER_FLAG(${flag} HAVE_C_${flag})
MY_CHECK_CXX_COMPILER_FLAG(${flag} HAVE_CXX_${flag}) MY_CHECK_CXX_COMPILER_FLAG(${flag} HAVE_CXX_${flag})
IF (HAVE_C_${flag} AND HAVE_CXX_${flag}) FOREACH(lang C CXX)
IF (HAVE_${lang}_${flag})
IF(ARGN) IF(ARGN)
FOREACH(type ${ARGN}) FOREACH(type ${ARGN})
SET(CMAKE_C_FLAGS_${type} "${CMAKE_C_FLAGS_${type}} ${flag}" PARENT_SCOPE) SET(CMAKE_${lang}_FLAGS_${type} "${CMAKE_${lang}_FLAGS_${type}} ${flag}" PARENT_SCOPE)
SET(CMAKE_CXX_FLAGS_${type} "${CMAKE_CXX_FLAGS_${type}} ${flag}" PARENT_SCOPE)
ENDFOREACH() ENDFOREACH()
ELSE() ELSE()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}" PARENT_SCOPE) SET(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} ${flag}" PARENT_SCOPE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" PARENT_SCOPE)
ENDIF() ENDIF()
ENDIF() ENDIF()
ENDFOREACH()
ENDFUNCTION() ENDFUNCTION()
usr/lib/mysql/plugin/auth_pam.so usr/lib/mysql/plugin/auth_pam.so
usr/lib/mysql/plugin/auth_socket.so usr/lib/mysql/plugin/auth_socket.so
usr/lib/mysql/plugin/file_key_management.so
usr/lib/mysql/plugin/ha_archive.so usr/lib/mysql/plugin/ha_archive.so
usr/lib/mysql/plugin/ha_blackhole.so usr/lib/mysql/plugin/ha_blackhole.so
usr/lib/mysql/plugin/ha_federated.so usr/lib/mysql/plugin/ha_federated.so
......
usr/lib/mysql/plugin/auth_pam.so usr/lib/mysql/plugin/auth_pam.so
usr/lib/mysql/plugin/auth_socket.so usr/lib/mysql/plugin/auth_socket.so
usr/lib/mysql/plugin/file_key_management.so
usr/lib/mysql/plugin/ha_archive.so usr/lib/mysql/plugin/ha_archive.so
usr/lib/mysql/plugin/ha_blackhole.so usr/lib/mysql/plugin/ha_blackhole.so
usr/lib/mysql/plugin/ha_federated.so usr/lib/mysql/plugin/ha_federated.so
......
usr/lib/mysql/plugin/debug_key_management.so
usr/lib/mysql/plugin/example_key_management.so
usr/lib/mysql/plugin/dialog_examples.so usr/lib/mysql/plugin/dialog_examples.so
usr/lib/mysql/plugin/auth_test_plugin.so usr/lib/mysql/plugin/auth_test_plugin.so
usr/lib/mysql/plugin/qa_auth_interface.so usr/lib/mysql/plugin/qa_auth_interface.so
......
/* Copyright (c) 2002, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Header file for my_aes.c */
/* 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"
C_MODE_START
#define AES_KEY_LENGTH 128 /* Must be 128 192 or 256 */
/**
Crypt buffer with AES dynamic (defined at startup) encryption algorithm.
SYNOPSIS
my_aes_encrypt_dynamic()
@param source [in] Pointer to data for encryption
@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 MYSQL_PLUGIN_IMPORT 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 MYSQL_PLUGIN_IMPORT 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
};
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 uchar *source, int source_length, uchar *dest,
const char *key, int key_length);
/**
DeCrypt buffer with AES encryption algorithm.
SYNOPSIS
my_aes_decrypt()
@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 uchar *source, int source_length, uchar *dest,
const char *key, int key_length);
/**
get size of buffer which will be large enough for encrypted data
SYNOPSIS
my_aes_get_size()
@param source_length Length of data to be encrypted
@return Size of buffer required to store encrypted data
*/
int my_aes_get_size(int source_length);
C_MODE_END
#endif /* MY_AES_INCLUDED */
...@@ -354,8 +354,7 @@ enum ha_base_keytype { ...@@ -354,8 +354,7 @@ 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_PRESERVE_INSERT_ORDER 512
#define HA_INSERT_ORDER 1024
/* Flags used by start_bulk_insert */ /* Flags used by start_bulk_insert */
......
// TODO: Add Windows support /*
Copyright (c) 2014 Google Inc.
Copyright (c) 2014, 2015 MariaDB Corporation
#ifndef MYSYS_MY_CRYPT_H_ This program is free software; you can redistribute it and/or modify
#define MYSYS_MY_CRYPT_H_ it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
#include <my_aes.h> This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
#if !defined(HAVE_YASSL) && defined(HAVE_OPENSSL) You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
C_MODE_START #ifndef MY_CRYPT_INCLUDED
Crypt_result my_aes_encrypt_ctr(const uchar* source, uint32 source_length, #define MY_CRYPT_INCLUDED
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, #include <my_global.h>
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, #ifdef __cplusplus
const uchar* iv, int iv_size, extern "C" {
const uchar* plaintext, int plaintext_size, #endif
uchar* ciphertext, int* ciphertext_used);
Crypt_result DecryptAes128Ctr(const uchar* key, /* return values from my_aes_encrypt/my_aes_decrypt functions */
const uchar* iv, int iv_size, #define MY_AES_OK 0
const uchar* ciphertext, int ciphertext_size, #define MY_AES_BAD_DATA -1
uchar* plaintext, int* plaintext_used); #define MY_AES_OPENSSL_ERROR -2
#define MY_AES_BAD_KEYSIZE -3
#endif /* !defined(HAVE_YASSL) && defined(HAVE_OPENSSL) */ /* The block size for all supported algorithms */
#define MY_AES_BLOCK_SIZE 16
C_MODE_START /* The max key length of all supported algorithms */
Crypt_result my_random_bytes(uchar* buf, int num); #define MY_AES_MAX_KEY_LENGTH 32
C_MODE_END
#endif /* MYSYS_MY_CRYPT_H_ */ #ifdef HAVE_EncryptAes128Ctr
int my_aes_encrypt_ctr(const uchar* source, uint source_length,
uchar* dest, uint* dest_length,
const uchar* key, uint key_length,
const uchar* iv, uint iv_length,
int no_padding);
int my_aes_decrypt_ctr(const uchar* source, uint source_length,
uchar* dest, uint* dest_length,
const uchar* key, uint key_length,
const uchar* iv, uint iv_length,
int no_padding);
#endif
int my_aes_encrypt_cbc(const uchar* source, uint source_length,
uchar* dest, uint* dest_length,
const uchar* key, uint key_length,
const uchar* iv, uint iv_length,
int no_padding);
int my_aes_decrypt_cbc(const uchar* source, uint source_length,
uchar* dest, uint* dest_length,
const uchar* key, uint key_length,
const uchar* iv, uint iv_length,
int no_padding);
int my_aes_encrypt_ecb(const uchar* source, uint source_length,
uchar* dest, uint* dest_length,
const uchar* key, uint key_length,
const uchar* iv, uint iv_length,
int no_padding);
int my_aes_decrypt_ecb(const uchar* source, uint source_length,
uchar* dest, uint* dest_length,
const uchar* key, uint key_length,
const uchar* iv, uint iv_length,
int no_padding);
int my_random_bytes(uchar* buf, int num);
int my_aes_get_size(int source_length);
#ifdef __cplusplus
}
#endif
#endif /* MY_CRYPT_INCLUDED */
...@@ -176,9 +176,6 @@ extern void _db_suicide_(); ...@@ -176,9 +176,6 @@ 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((unsigned char *)A,B,C) #define compute_md5_hash(A,B,C) my_md5(A,B,C)
/* /*
Convert an array of bytes to a hexadecimal representation. Convert an array of bytes to a hexadecimal representation.
......
...@@ -92,7 +92,7 @@ typedef struct st_mysql_xid MYSQL_XID; ...@@ -92,7 +92,7 @@ typedef struct st_mysql_xid MYSQL_XID;
/* MariaDB plugin types */ /* MariaDB plugin types */
#define MariaDB_PASSWORD_VALIDATION_PLUGIN 8 #define MariaDB_PASSWORD_VALIDATION_PLUGIN 8
#define MariaDB_ENCRYPTION_KEY_MANAGEMENT_PLUGIN 9 #define MariaDB_ENCRYPTION_PLUGIN 9
/* We use the following strings to define licenses for plugins */ /* We use the following strings to define licenses for plugins */
#define PLUGIN_LICENSE_PROPRIETARY 0 #define PLUGIN_LICENSE_PROPRIETARY 0
......
...@@ -197,19 +197,22 @@ int thd_key_create(MYSQL_THD_KEY_T *key); ...@@ -197,19 +197,22 @@ int thd_key_create(MYSQL_THD_KEY_T *key);
void thd_key_delete(MYSQL_THD_KEY_T *key); void thd_key_delete(MYSQL_THD_KEY_T *key);
void* thd_getspecific(void* thd, MYSQL_THD_KEY_T key); void* thd_getspecific(void* thd, MYSQL_THD_KEY_T key);
int thd_setspecific(void* thd, MYSQL_THD_KEY_T key, void *value); int thd_setspecific(void* thd, MYSQL_THD_KEY_T key, void *value);
#include <mysql/service_encryption_keys.h> #include <mysql/service_encryption.h>
extern struct encryption_keys_service_st { typedef int (*encrypt_decrypt_func)(const unsigned char* src, unsigned int slen,
unsigned int (*get_latest_encryption_key_version_func)(); unsigned char* dst, unsigned int* dlen,
unsigned int (*has_encryption_key_func)(unsigned int); const unsigned char* key, unsigned int klen,
unsigned int (*get_encryption_key_size_func)(unsigned int); const unsigned char* iv, unsigned int ivlen,
int (*get_encryption_key_func)(unsigned int, unsigned char*, unsigned int); int no_padding, unsigned int key_id,
int (*get_encryption_iv_func)(unsigned int, unsigned char*, unsigned int); unsigned int key_version);
} *encryption_keys_service; struct encryption_service_st {
unsigned int get_latest_encryption_key_version(); unsigned int (*encryption_key_get_latest_version_func)(unsigned int);
unsigned int has_encryption_key(unsigned int version); unsigned int (*encryption_key_id_exists_func)(unsigned int);
unsigned int get_encryption_key_size(unsigned int version); unsigned int (*encryption_key_version_exists_func)(unsigned int, unsigned int);
int get_encryption_key(unsigned int version, unsigned char* key, unsigned int keybufsize); unsigned int (*encryption_key_get_func)(unsigned int, unsigned int, unsigned char*, unsigned int*);
int get_encryption_iv(unsigned int version, unsigned char* iv, unsigned int ivbufsize); encrypt_decrypt_func encryption_encrypt_func;
encrypt_decrypt_func encryption_decrypt_func;
};
extern struct encryption_service_st encryption_handler;
struct st_mysql_xid { struct st_mysql_xid {
long formatID; long formatID;
long gtrid_length; long gtrid_length;
......
...@@ -197,19 +197,22 @@ int thd_key_create(MYSQL_THD_KEY_T *key); ...@@ -197,19 +197,22 @@ int thd_key_create(MYSQL_THD_KEY_T *key);
void thd_key_delete(MYSQL_THD_KEY_T *key); void thd_key_delete(MYSQL_THD_KEY_T *key);
void* thd_getspecific(void* thd, MYSQL_THD_KEY_T key); void* thd_getspecific(void* thd, MYSQL_THD_KEY_T key);
int thd_setspecific(void* thd, MYSQL_THD_KEY_T key, void *value); int thd_setspecific(void* thd, MYSQL_THD_KEY_T key, void *value);
#include <mysql/service_encryption_keys.h> #include <mysql/service_encryption.h>
extern struct encryption_keys_service_st { typedef int (*encrypt_decrypt_func)(const unsigned char* src, unsigned int slen,
unsigned int (*get_latest_encryption_key_version_func)(); unsigned char* dst, unsigned int* dlen,
unsigned int (*has_encryption_key_func)(unsigned int); const unsigned char* key, unsigned int klen,
unsigned int (*get_encryption_key_size_func)(unsigned int); const unsigned char* iv, unsigned int ivlen,
int (*get_encryption_key_func)(unsigned int, unsigned char*, unsigned int); int no_padding, unsigned int key_id,
int (*get_encryption_iv_func)(unsigned int, unsigned char*, unsigned int); unsigned int key_version);
} *encryption_keys_service; struct encryption_service_st {
unsigned int get_latest_encryption_key_version(); unsigned int (*encryption_key_get_latest_version_func)(unsigned int);
unsigned int has_encryption_key(unsigned int version); unsigned int (*encryption_key_id_exists_func)(unsigned int);
unsigned int get_encryption_key_size(unsigned int version); unsigned int (*encryption_key_version_exists_func)(unsigned int, unsigned int);
int get_encryption_key(unsigned int version, unsigned char* key, unsigned int keybufsize); unsigned int (*encryption_key_get_func)(unsigned int, unsigned int, unsigned char*, unsigned int*);
int get_encryption_iv(unsigned int version, unsigned char* iv, unsigned int ivbufsize); encrypt_decrypt_func encryption_encrypt_func;
encrypt_decrypt_func encryption_decrypt_func;
};
extern struct encryption_service_st encryption_handler;
struct st_mysql_xid { struct st_mysql_xid {
long formatID; long formatID;
long gtrid_length; long gtrid_length;
......
#ifndef MYSQL_PLUGIN_ENCRYPTION_KEY_MANAGEMENT_INCLUDED #ifndef MYSQL_PLUGIN_ENCRYPTION_INCLUDED
/* Copyright (C) 2014 Sergei Golubchik and MariaDB /* Copyright (C) 2014, 2015 Sergei Golubchik and MariaDB
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -17,57 +17,57 @@ ...@@ -17,57 +17,57 @@
/** /**
@file @file
Encryption key Management Plugin API. Encryption Plugin API.
This file defines the API for server plugins that manage encryption This file defines the API for server plugins that manage encryption
keys for MariaDB on-disk data encryption. keys for MariaDB on-disk data encryption.
*/ */
#define MYSQL_PLUGIN_ENCRYPTION_KEY_MANAGEMENT_INCLUDED #define MYSQL_PLUGIN_ENCRYPTION_INCLUDED
#include <mysql/plugin.h> #include <mysql/plugin.h>
#define MariaDB_ENCRYPTION_KEY_MANAGEMENT_INTERFACE_VERSION 0x0100 #define MariaDB_ENCRYPTION_INTERFACE_VERSION 0x0200
#define BAD_ENCRYPTION_KEY_VERSION (UINT_MAX32)
/** /**
Encryption key management plugin descriptor Encryption plugin descriptor
*/ */
struct st_mariadb_encryption_key_management struct st_mariadb_encryption
{ {
int interface_version; /**< version plugin uses */ int interface_version; /**< version plugin uses */
/** /**
function returning latest key version. function returning latest key version for a given key id
@return a version or BAD_ENCRYPTION_KEY_VERSION to indicate an error. @return a version or ENCRYPTION_KEY_VERSION_INVALID to indicate an error.
*/ */
unsigned int (*get_latest_key_version)(); unsigned int (*get_latest_key_version)(unsigned int key_id);
/** function returning if a key of the given version exists */
unsigned int (*has_key_version)(unsigned int version);
/** function returning the key size in bytes */
unsigned int (*get_key_size)(unsigned int version);
/** /**
function returning a key for a key version function returning a key for a key version
the key is put in 'key' buffer, that has size of 'keybufsize' bytes. @param version the requested key version
@param key the key will be stored there. Can be NULL -
in which case no key will be returned
@param key_length in: key buffer size
out: the actual length of the key
@return 0 on success, non-zero on failure This method can be used to query the key length - the required
*/ buffer size - by passing key==NULL.
int (*get_key)(unsigned int version, unsigned char* key, unsigned int keybufsize);
/** If the buffer size is less than the key length the content of the
function returning an IV for a key version key buffer is undefined (the plugin is free to partially fill it with
the key data or leave it untouched).
the IV is put in 'iv' buffer, that has size of 'ivbufsize' bytes.
@return 0 on success, non-zero on failure @return 0 on success, or
ENCRYPTION_KEY_VERSION_INVALID, ENCRYPTION_KEY_BUFFER_TOO_SMALL
or any other non-zero number for errors
*/ */
int (*get_iv)(unsigned int version, unsigned char* iv, unsigned int ivbufsize); unsigned int (*get_key)(unsigned int key_id, unsigned int version,
unsigned char *key, unsigned int *key_length);
encrypt_decrypt_func encrypt;
encrypt_decrypt_func decrypt;
}; };
#endif #endif
...@@ -197,19 +197,22 @@ int thd_key_create(MYSQL_THD_KEY_T *key); ...@@ -197,19 +197,22 @@ int thd_key_create(MYSQL_THD_KEY_T *key);
void thd_key_delete(MYSQL_THD_KEY_T *key); void thd_key_delete(MYSQL_THD_KEY_T *key);
void* thd_getspecific(void* thd, MYSQL_THD_KEY_T key); void* thd_getspecific(void* thd, MYSQL_THD_KEY_T key);
int thd_setspecific(void* thd, MYSQL_THD_KEY_T key, void *value); int thd_setspecific(void* thd, MYSQL_THD_KEY_T key, void *value);
#include <mysql/service_encryption_keys.h> #include <mysql/service_encryption.h>
extern struct encryption_keys_service_st { typedef int (*encrypt_decrypt_func)(const unsigned char* src, unsigned int slen,
unsigned int (*get_latest_encryption_key_version_func)(); unsigned char* dst, unsigned int* dlen,
unsigned int (*has_encryption_key_func)(unsigned int); const unsigned char* key, unsigned int klen,
unsigned int (*get_encryption_key_size_func)(unsigned int); const unsigned char* iv, unsigned int ivlen,
int (*get_encryption_key_func)(unsigned int, unsigned char*, unsigned int); int no_padding, unsigned int key_id,
int (*get_encryption_iv_func)(unsigned int, unsigned char*, unsigned int); unsigned int key_version);
} *encryption_keys_service; struct encryption_service_st {
unsigned int get_latest_encryption_key_version(); unsigned int (*encryption_key_get_latest_version_func)(unsigned int);
unsigned int has_encryption_key(unsigned int version); unsigned int (*encryption_key_id_exists_func)(unsigned int);
unsigned int get_encryption_key_size(unsigned int version); unsigned int (*encryption_key_version_exists_func)(unsigned int, unsigned int);
int get_encryption_key(unsigned int version, unsigned char* key, unsigned int keybufsize); unsigned int (*encryption_key_get_func)(unsigned int, unsigned int, unsigned char*, unsigned int*);
int get_encryption_iv(unsigned int version, unsigned char* iv, unsigned int ivbufsize); encrypt_decrypt_func encryption_encrypt_func;
encrypt_decrypt_func encryption_decrypt_func;
};
extern struct encryption_service_st encryption_handler;
struct st_mysql_xid { struct st_mysql_xid {
long formatID; long formatID;
long gtrid_length; long gtrid_length;
...@@ -366,12 +369,12 @@ void *thd_get_ha_data(const void* thd, const struct handlerton *hton); ...@@ -366,12 +369,12 @@ void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
void thd_set_ha_data(void* thd, const struct handlerton *hton, void thd_set_ha_data(void* thd, const struct handlerton *hton,
const void *ha_data); const void *ha_data);
void thd_wakeup_subsequent_commits(void* thd, int wakeup_error); void thd_wakeup_subsequent_commits(void* thd, int wakeup_error);
struct st_mariadb_encryption_key_management struct st_mariadb_encryption
{ {
int interface_version; int interface_version;
unsigned int (*get_latest_key_version)(); unsigned int (*get_latest_key_version)(unsigned int key_id);
unsigned int (*has_key_version)(unsigned int version); unsigned int (*get_key)(unsigned int key_id, unsigned int version,
unsigned int (*get_key_size)(unsigned int version); unsigned char *key, unsigned int *key_length);
int (*get_key)(unsigned int version, unsigned char* key, unsigned int keybufsize); encrypt_decrypt_func encrypt;
int (*get_iv)(unsigned int version, unsigned char* iv, unsigned int ivbufsize); encrypt_decrypt_func decrypt;
}; };
...@@ -197,19 +197,22 @@ int thd_key_create(MYSQL_THD_KEY_T *key); ...@@ -197,19 +197,22 @@ int thd_key_create(MYSQL_THD_KEY_T *key);
void thd_key_delete(MYSQL_THD_KEY_T *key); void thd_key_delete(MYSQL_THD_KEY_T *key);
void* thd_getspecific(void* thd, MYSQL_THD_KEY_T key); void* thd_getspecific(void* thd, MYSQL_THD_KEY_T key);
int thd_setspecific(void* thd, MYSQL_THD_KEY_T key, void *value); int thd_setspecific(void* thd, MYSQL_THD_KEY_T key, void *value);
#include <mysql/service_encryption_keys.h> #include <mysql/service_encryption.h>
extern struct encryption_keys_service_st { typedef int (*encrypt_decrypt_func)(const unsigned char* src, unsigned int slen,
unsigned int (*get_latest_encryption_key_version_func)(); unsigned char* dst, unsigned int* dlen,
unsigned int (*has_encryption_key_func)(unsigned int); const unsigned char* key, unsigned int klen,
unsigned int (*get_encryption_key_size_func)(unsigned int); const unsigned char* iv, unsigned int ivlen,
int (*get_encryption_key_func)(unsigned int, unsigned char*, unsigned int); int no_padding, unsigned int key_id,
int (*get_encryption_iv_func)(unsigned int, unsigned char*, unsigned int); unsigned int key_version);
} *encryption_keys_service; struct encryption_service_st {
unsigned int get_latest_encryption_key_version(); unsigned int (*encryption_key_get_latest_version_func)(unsigned int);
unsigned int has_encryption_key(unsigned int version); unsigned int (*encryption_key_id_exists_func)(unsigned int);
unsigned int get_encryption_key_size(unsigned int version); unsigned int (*encryption_key_version_exists_func)(unsigned int, unsigned int);
int get_encryption_key(unsigned int version, unsigned char* key, unsigned int keybufsize); unsigned int (*encryption_key_get_func)(unsigned int, unsigned int, unsigned char*, unsigned int*);
int get_encryption_iv(unsigned int version, unsigned char* iv, unsigned int ivbufsize); encrypt_decrypt_func encryption_encrypt_func;
encrypt_decrypt_func encryption_decrypt_func;
};
extern struct encryption_service_st encryption_handler;
struct st_mysql_xid { struct st_mysql_xid {
long formatID; long formatID;
long gtrid_length; long gtrid_length;
......
...@@ -197,19 +197,22 @@ int thd_key_create(MYSQL_THD_KEY_T *key); ...@@ -197,19 +197,22 @@ int thd_key_create(MYSQL_THD_KEY_T *key);
void thd_key_delete(MYSQL_THD_KEY_T *key); void thd_key_delete(MYSQL_THD_KEY_T *key);
void* thd_getspecific(void* thd, MYSQL_THD_KEY_T key); void* thd_getspecific(void* thd, MYSQL_THD_KEY_T key);
int thd_setspecific(void* thd, MYSQL_THD_KEY_T key, void *value); int thd_setspecific(void* thd, MYSQL_THD_KEY_T key, void *value);
#include <mysql/service_encryption_keys.h> #include <mysql/service_encryption.h>
extern struct encryption_keys_service_st { typedef int (*encrypt_decrypt_func)(const unsigned char* src, unsigned int slen,
unsigned int (*get_latest_encryption_key_version_func)(); unsigned char* dst, unsigned int* dlen,
unsigned int (*has_encryption_key_func)(unsigned int); const unsigned char* key, unsigned int klen,
unsigned int (*get_encryption_key_size_func)(unsigned int); const unsigned char* iv, unsigned int ivlen,
int (*get_encryption_key_func)(unsigned int, unsigned char*, unsigned int); int no_padding, unsigned int key_id,
int (*get_encryption_iv_func)(unsigned int, unsigned char*, unsigned int); unsigned int key_version);
} *encryption_keys_service; struct encryption_service_st {
unsigned int get_latest_encryption_key_version(); unsigned int (*encryption_key_get_latest_version_func)(unsigned int);
unsigned int has_encryption_key(unsigned int version); unsigned int (*encryption_key_id_exists_func)(unsigned int);
unsigned int get_encryption_key_size(unsigned int version); unsigned int (*encryption_key_version_exists_func)(unsigned int, unsigned int);
int get_encryption_key(unsigned int version, unsigned char* key, unsigned int keybufsize); unsigned int (*encryption_key_get_func)(unsigned int, unsigned int, unsigned char*, unsigned int*);
int get_encryption_iv(unsigned int version, unsigned char* iv, unsigned int ivbufsize); encrypt_decrypt_func encryption_encrypt_func;
encrypt_decrypt_func encryption_decrypt_func;
};
extern struct encryption_service_st encryption_handler;
struct st_mysql_xid { struct st_mysql_xid {
long formatID; long formatID;
long gtrid_length; long gtrid_length;
......
#ifndef MYSQL_SERVICE_CRYPTOKEYS_INCLUDED
/* Copyright (c) 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
cryptokeys service
Functions get cryptographical keys and IV from the cryptokey management plugin
*/
#ifdef __cplusplus
extern "C" {
#endif
extern struct cryptokeys_service_st {
unsigned int (*get_latest_crypto_key_version_func)();
unsigned int (*has_crypto_key_func)(unsigned int);
unsigned int (*get_crypto_key_size_func)(unsigned int);
int (*get_crypto_key_func)(unsigned int, unsigned char*, unsigned int);
int (*get_crypto_iv_func)(unsigned int, unsigned char*, unsigned int);
} *cryptokeys_service;
#ifdef MYSQL_DYNAMIC_PLUGIN
#define get_latest_crypto_key_version() cryptokeys_service->get_latest_crypto_key_version_func()
#define has_crypto_key(V) cryptokeys_service->has_crypto_key_func(V)
#define get_crypto_key_size(V) cryptokeys_service->get_crypto_key_size_func(V)
#define get_crypto_key(V,K,S) cryptokeys_service->get_crypto_key_func((V), (K), (S))
#define get_crypto_iv(V, I, S) cryptokeys_service->get_crypto_iv_func((V), (I), (S))
#else
unsigned int get_latest_crypto_key_version();
unsigned int has_crypto_key(unsigned int version);
unsigned int get_crypto_key_size(unsigned int version);
int get_crypto_key(unsigned int version, unsigned char* key, unsigned int keybufsize);
int get_crypto_iv(unsigned int version, unsigned char* iv, unsigned int ivbufsize);
#endif
#ifdef __cplusplus
}
#endif
#define MYSQL_SERVICE_CRYPTOKEYS_INCLUDED
#endif
#ifndef MYSQL_SERVICE_ENCRYPTION_INCLUDED
/* Copyright (c) 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
encryption service
Functions to support data encryption and encryption key management.
They are normally implemented in an encryption plugin, so this service
connects encryption *consumers* (storage engines) to the encryption
*provider* (encryption plugin).
*/
#ifdef __cplusplus
extern "C" {
#endif
/* returned from encryption_key_get_latest_version() */
#define ENCRYPTION_KEY_VERSION_INVALID (~(unsigned int)0)
#define ENCRYPTION_KEY_NOT_ENCRYPTED (0)
/* returned from encryption_key_get() */
#define ENCRYPTION_KEY_BUFFER_TOO_SMALL (100)
typedef int (*encrypt_decrypt_func)(const unsigned char* src, unsigned int slen,
unsigned char* dst, unsigned int* dlen,
const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen,
int no_padding, unsigned int key_id,
unsigned int key_version);
struct encryption_service_st {
unsigned int (*encryption_key_get_latest_version_func)(unsigned int);
unsigned int (*encryption_key_id_exists_func)(unsigned int);
unsigned int (*encryption_key_version_exists_func)(unsigned int, unsigned int);
unsigned int (*encryption_key_get_func)(unsigned int, unsigned int, unsigned char*, unsigned int*);
encrypt_decrypt_func encryption_encrypt_func;
encrypt_decrypt_func encryption_decrypt_func;
};
#ifdef MYSQL_DYNAMIC_PLUGIN
extern struct encryption_service_st *encryption_service;
#define encryption_key_get_latest_version(KI) encryption_service->encryption_key_get_latest_version_func(KI)
#define encryption_key_id_exists(KI) encryption_service->encryption_key_id_exists_func((KI))
#define encryption_key_version_exists(KI,KV) encryption_service->encryption_key_version_exists_func((KI),(KV))
#define encryption_key_get(KI,KV,K,S) encryption_service->encryption_key_get_func((KI),(KV),(K),(S))
#define encryption_encrypt(S,SL,D,DL,K,KL,I,IL,NP,KI,KV) encryption_service->encryption_encrypt_func((S),(SL),(D),(DL),(K),(KL),(I),(IL),(NP),(KI),(KV))
#define encryption_decrypt(S,SL,D,DL,K,KL,I,IL,NP,KI,KV) encryption_service->encryption_decrypt_func((S),(SL),(D),(DL),(K),(KL),(I),(IL),(NP),(KI),(KV))
#else
extern struct encryption_service_st encryption_handler;
#define encryption_key_get_latest_version(KI) encryption_handler.encryption_key_get_latest_version_func(KI)
#define encryption_key_id_exists(KI) encryption_handler.encryption_key_id_exists_func((KI))
#define encryption_key_version_exists(KI,KV) encryption_handler.encryption_key_version_exists_func((KI),(KV))
#define encryption_key_get(KI,KV,K,S) encryption_handler.encryption_key_get_func((KI),(KV),(K),(S))
#define encryption_encrypt(S,SL,D,DL,K,KL,I,IL,NP,KI,KV) encryption_handler.encryption_encrypt_func((S),(SL),(D),(DL),(K),(KL),(I),(IL),(NP),(KI),(KV))
#define encryption_decrypt(S,SL,D,DL,K,KL,I,IL,NP,KI,KV) encryption_handler.encryption_decrypt_func((S),(SL),(D),(DL),(K),(KL),(I),(IL),(NP),(KI),(KV))
#endif
#ifdef __cplusplus
}
#endif
#define MYSQL_SERVICE_ENCRYPTION_INCLUDED
#endif
#ifndef MYSQL_SERVICE_ENCRYPTION_KEYS_INCLUDED
/* Copyright (c) 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
encryption keys service
Functions to get encryption keys and IV from the encryption key management plugin
*/
#ifdef __cplusplus
extern "C" {
#endif
extern struct encryption_keys_service_st {
unsigned int (*get_latest_encryption_key_version_func)();
unsigned int (*has_encryption_key_func)(unsigned int);
unsigned int (*get_encryption_key_size_func)(unsigned int);
int (*get_encryption_key_func)(unsigned int, unsigned char*, unsigned int);
int (*get_encryption_iv_func)(unsigned int, unsigned char*, unsigned int);
} *encryption_keys_service;
#ifdef MYSQL_DYNAMIC_PLUGIN
#define get_latest_encryption_key_version() encryption_keys_service->get_latest_encryption_key_version_func()
#define has_encryption_key(V) encryption_keys_service->has_encryption_key_func(V)
#define get_encryption_key_size(V) encryption_keys_service->get_encryption_key_size_func(V)
#define get_encryption_key(V,K,S) encryption_keys_service->get_encryption_key_func((V), (K), (S))
#define get_encryption_iv(V, I, S) encryption_keys_service->get_encryption_iv_func((V), (I), (S))
#else
unsigned int get_latest_encryption_key_version();
unsigned int has_encryption_key(unsigned int version);
unsigned int get_encryption_key_size(unsigned int version);
int get_encryption_key(unsigned int version, unsigned char* key, unsigned int keybufsize);
int get_encryption_iv(unsigned int version, unsigned char* iv, unsigned int ivbufsize);
#endif
#ifdef __cplusplus
}
#endif
#define MYSQL_SERVICE_ENCRYPTION_KEYS_INCLUDED
#endif
...@@ -44,10 +44,10 @@ extern struct my_sha1_service_st { ...@@ -44,10 +44,10 @@ extern struct my_sha1_service_st {
#define my_sha1(A,B,C) my_sha1_service->my_sha1_type(A,B,C) #define my_sha1(A,B,C) my_sha1_service->my_sha1_type(A,B,C)
#define my_sha1_multi my_sha1_service->my_sha1_multi_type #define my_sha1_multi my_sha1_service->my_sha1_multi_type
#define my_sha1_context_size_type() my_sha1_service->my_sha1_context_size_type() #define my_sha1_context_size() my_sha1_service->my_sha1_context_size_type()
#define my_sha1_init_type(A) my_sha1_service->my_sha1_init_type(A) #define my_sha1_init(A) my_sha1_service->my_sha1_init_type(A)
#define my_sha1_input_type(A,B,C) my_sha1_service->my_sha1_input_type(A,B,C) #define my_sha1_input(A,B,C) my_sha1_service->my_sha1_input_type(A,B,C)
#define my_sha1_result_type(A,B) my_sha1_service->my_sha1_result_type(A,B) #define my_sha1_result(A,B) my_sha1_service->my_sha1_result_type(A,B)
#else #else
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
/** /**
@file @file
This service provdes functions to allocate memory in a connection local This service provides functions to allocate memory in a connection local
memory pool. The memory allocated there will be automatically freed at the memory pool. The memory allocated there will be automatically freed at the
end of the statement, don't use it for allocations that should live longer end of the statement, don't use it for allocations that should live longer
than that. For short living allocations this is more efficient than than that. For short living allocations this is more efficient than
......
...@@ -32,7 +32,7 @@ extern "C" { ...@@ -32,7 +32,7 @@ extern "C" {
#include <mysql/service_thd_autoinc.h> #include <mysql/service_thd_autoinc.h>
#include <mysql/service_thd_error_context.h> #include <mysql/service_thd_error_context.h>
#include <mysql/service_thd_specifics.h> #include <mysql/service_thd_specifics.h>
#include <mysql/service_encryption_keys.h> #include <mysql/service_encryption.h>
/*#include <mysql/service_wsrep.h>*/ /*#include <mysql/service_wsrep.h>*/
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -35,5 +35,5 @@ ...@@ -35,5 +35,5 @@
#define VERSION_thd_autoinc 0x0100 #define VERSION_thd_autoinc 0x0100
#define VERSION_thd_error_context 0x0100 #define VERSION_thd_error_context 0x0100
#define VERSION_thd_specifics 0x0100 #define VERSION_thd_specifics 0x0100
#define VERSION_encryption_keys 0x0100 #define VERSION_encryption 0x0200
...@@ -106,7 +106,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc ...@@ -106,7 +106,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/compat56.cc ../sql/compat56.cc
../sql/table_cache.cc ../sql/table_cache.cc
../sql/item_inetfunc.cc ../sql/item_inetfunc.cc
../sql/wsrep_dummy.cc ../sql/encryption_keys.cc ../sql/wsrep_dummy.cc ../sql/encryption.cc
${GEN_SOURCES} ${GEN_SOURCES}
${MYSYS_LIBWRAP_SOURCE} ${MYSYS_LIBWRAP_SOURCE}
) )
......
...@@ -28,7 +28,7 @@ SET(MYSQLSERVICES_SOURCES ...@@ -28,7 +28,7 @@ SET(MYSQLSERVICES_SOURCES
my_sha1_service.c my_sha1_service.c
my_md5_service.c my_md5_service.c
wsrep_service.c wsrep_service.c
encryption_keys_service.c encryption_service.c
kill_statement_service.c kill_statement_service.c
logger_service.c) logger_service.c)
......
/* Copyright (c) 2015 MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <service_versions.h>
SERVICE_VERSION encryption_keys_service= (void*)VERSION_encryption_keys;
...@@ -14,4 +14,4 @@ ...@@ -14,4 +14,4 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <service_versions.h> #include <service_versions.h>
SERVICE_VERSION cryptokeys_service= (void*)VERSION_cryptokeys; SERVICE_VERSION encryption_service= (void*)VERSION_encryption;
[cbc] [cbc]
encryption-algorithm=aes_cbc file-key-management-encryption-algorithm=aes_cbc
[ecb]
encryption-algorithm=aes_ecb
[ctr] [ctr]
encryption-algorithm=aes_ctr file-key-management-encryption-algorithm=aes_ctr
-- source encryption_algorithms.inc if (!$EXAMPLE_KEY_MANAGEMENT_SO)
if (`select count(*) = 0 from information_schema.plugins
where plugin_name = 'example_key_management_plugin' and plugin_status='active'`)
{ {
--skip Needs example_key_management_plugin --skip Needs example_key_management
} }
--plugin-load-add=$EXAMPLE_KEY_MANAGEMENT_PLUGIN_SO --plugin-load-add=$EXAMPLE_KEY_MANAGEMENT_SO
--loose-example-key-management-plugin --loose-example-key-management
-- source encryption_algorithms.inc --source encryption_algorithms.inc
if (`select count(*) = 0 from information_schema.plugins if (!$FILE_KEY_MANAGEMENT_SO)
where plugin_name = 'file_key_management_plugin' and plugin_status='active'`)
{ {
--skip Needs file_key_management_plugin --skip Needs file_key_management
} }
--plugin-load-add=$FILE_KEY_MANAGEMENT_PLUGIN_SO --plugin-load-add=$FILE_KEY_MANAGEMENT_SO
--loose-file-key-management-plugin --loose-file-key-management
--loose-file-key-management-plugin-filename=$MYSQL_TEST_DIR/std_data/keys.txt --loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
...@@ -65,7 +65,7 @@ perl; ...@@ -65,7 +65,7 @@ perl;
my $search_range= $ENV{'SEARCH_RANGE'}; my $search_range= $ENV{'SEARCH_RANGE'};
my $file_content; my $file_content;
$search_range= 50000 unless $search_range =~ /-?[0-9]+/; $search_range= 50000 unless $search_range =~ /-?[0-9]+/;
open(FILE, "$search_file") or die("Unable to open '$search_file': $!\n"); open(FILE, '<', $search_file) or die("Unable to open '$search_file': $!\n");
if ($search_range >= 0) { if ($search_range >= 0) {
read(FILE, $file_content, $search_range, 0); read(FILE, $file_content, $search_range, 0);
} else { } else {
...@@ -75,7 +75,10 @@ perl; ...@@ -75,7 +75,10 @@ perl;
read(FILE, $file_content, -$search_range, 0); read(FILE, $file_content, -$search_range, 0);
} }
close(FILE); close(FILE);
if ( not $file_content =~ m{$search_pattern} ) { $search_file =~ s{^.*?([^/\\]+)$}{$1};
die("# ERROR: The file '$search_file' does not contain the expected pattern $search_pattern\n->$file_content<-\n"); if ($file_content =~ m{$search_pattern}) {
print "FOUND /$search_pattern/ in $search_file\n"
} else {
print "NOT FOUND /$search_pattern/ in $search_file\n"
} }
EOF EOF
...@@ -618,7 +618,7 @@ sub make_combinations($$@) ...@@ -618,7 +618,7 @@ sub make_combinations($$@)
if (My::Options::is_set($test->{master_opt}, $comb->{comb_opt}) && if (My::Options::is_set($test->{master_opt}, $comb->{comb_opt}) &&
My::Options::is_set($test->{slave_opt}, $comb->{comb_opt}) ){ My::Options::is_set($test->{slave_opt}, $comb->{comb_opt}) ){
delete $test_combs->{$comb->{name}}; $test_combs->{$comb->{name}} = 2;
# Add combination name short name # Add combination name short name
push @{$test->{combinations}}, $comb->{name}; push @{$test->{combinations}}, $comb->{name};
...@@ -627,8 +627,9 @@ sub make_combinations($$@) ...@@ -627,8 +627,9 @@ sub make_combinations($$@)
} }
# Skip all other combinations, if this combination is forced # Skip all other combinations, if this combination is forced
if (delete $test_combs->{$comb->{name}}) { if ($test_combs->{$comb->{name}}) {
@combinations = ($comb); # run the loop below only for this combination @combinations = ($comb); # run the loop below only for this combination
$test_combs->{$comb->{name}} = 2;
last; last;
} }
} }
...@@ -858,9 +859,10 @@ sub collect_one_test_case { ...@@ -858,9 +859,10 @@ sub collect_one_test_case {
{ {
@cases = map make_combinations($_, \%test_combs, @{$comb}), @cases; @cases = map make_combinations($_, \%test_combs, @{$comb}), @cases;
} }
if (keys %test_combs) { my @no_combs = grep { $test_combs{$_} == 1 } keys %test_combs;
if (@no_combs) {
mtr_error("Could not run $name with '".( mtr_error("Could not run $name with '".(
join(',', sort keys %test_combs))."' combination(s)"); join(',', sort @no_combs))."' combination(s)");
} }
for $tinfo (@cases) { for $tinfo (@cases) {
......
...@@ -2007,3 +2007,22 @@ INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8); ...@@ -2007,3 +2007,22 @@ INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e; INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e;
ALTER TABLE t1 MODIFY i FLOAT; ALTER TABLE t1 MODIFY i FLOAT;
DROP TABLE t1; DROP TABLE t1;
#
# Start of 10.1 tests
#
#
# MDEV-7816 ALTER with DROP INDEX and ADD INDEX .. COMMENT='comment2' ignores the new comment
#
CREATE TABLE t1(a INT);
CREATE INDEX i1 ON t1(a) COMMENT 'comment1';
ALTER TABLE t1 DROP INDEX i1, ADD INDEX i1(a) COMMENT 'comment2';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
KEY `i1` (`a`) COMMENT 'comment2'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# Start of 10.1 tests
#
...@@ -165,10 +165,6 @@ The following options may be given as the first argument: ...@@ -165,10 +165,6 @@ The following options may be given as the first argument:
--encrypt-tmp-disk-tables --encrypt-tmp-disk-tables
Encrypt tmp disk tables (created as part of query Encrypt tmp disk tables (created as part of query
execution) 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
--enforce-storage-engine=name --enforce-storage-engine=name
Force the use of a storage engine for new tables Force the use of a storage engine for new tables
--event-scheduler[=name] --event-scheduler[=name]
...@@ -1151,7 +1147,6 @@ delayed-insert-timeout 300 ...@@ -1151,7 +1147,6 @@ 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 encrypt-tmp-disk-tables FALSE
encryption-algorithm none
enforce-storage-engine (No default value) enforce-storage-engine (No default value)
event-scheduler OFF event-scheduler OFF
expensive-subquery-limit 100 expensive-subquery-limit 100
......
...@@ -7,7 +7,7 @@ show create table t1; ...@@ -7,7 +7,7 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL `a` int(11) NOT NULL
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`='5' ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (a) /*!50100 PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (1) ENGINE = EXAMPLE, (PARTITION p0 VALUES IN (1) ENGINE = EXAMPLE,
PARTITION p1 VALUES IN (2) ENGINE = EXAMPLE) */ PARTITION p1 VALUES IN (2) ENGINE = EXAMPLE) */
...@@ -20,7 +20,7 @@ show create table t1; ...@@ -20,7 +20,7 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL `a` int(11) NOT NULL
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340 `VAROPT`='5' ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340
/*!50100 PARTITION BY LIST (a) /*!50100 PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (1) ENGINE = EXAMPLE, (PARTITION p0 VALUES IN (1) ENGINE = EXAMPLE,
PARTITION p1 VALUES IN (2) ENGINE = EXAMPLE) */ PARTITION p1 VALUES IN (2) ENGINE = EXAMPLE) */
......
...@@ -127,7 +127,7 @@ show create table t1; ...@@ -127,7 +127,7 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `complex`='c,f,f,f' `a` int(11) DEFAULT NULL `complex`='c,f,f,f'
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=10000 `STR`='dskj' `one_or_two`='one' `YESNO`=0 `VAROPT`='5' ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=10000 `STR`='dskj' `one_or_two`='one' `YESNO`=0
drop table t1; drop table t1;
SET @OLD_SQL_MODE=@@SQL_MODE; SET @OLD_SQL_MODE=@@SQL_MODE;
SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS'; SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS';
...@@ -142,7 +142,7 @@ Table Create Table ...@@ -142,7 +142,7 @@ Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL, `a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL `b` int(11) DEFAULT NULL
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=10000000000000000000 `one_or_two`='ttt' `YESNO`=SSS `VAROPT`='5' ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=10000000000000000000 `one_or_two`='ttt' `YESNO`=SSS
#alter table #alter table
alter table t1 ULL=10000000; alter table t1 ULL=10000000;
Warnings: Warnings:
...@@ -152,7 +152,7 @@ Table Create Table ...@@ -152,7 +152,7 @@ Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL, `a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL `b` int(11) DEFAULT NULL
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `one_or_two`='ttt' `YESNO`=SSS `VAROPT`='5' `ULL`=10000000 ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `one_or_two`='ttt' `YESNO`=SSS `ULL`=10000000
alter table t1 change a a int complex='c,c,c'; alter table t1 change a a int complex='c,c,c';
Warnings: Warnings:
Note 1105 EXAMPLE DEBUG: Field `a` COMPLEX '(null)' -> 'c,c,c' Note 1105 EXAMPLE DEBUG: Field `a` COMPLEX '(null)' -> 'c,c,c'
...@@ -161,14 +161,14 @@ Table Create Table ...@@ -161,14 +161,14 @@ Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `complex`='c,c,c', `a` int(11) DEFAULT NULL `complex`='c,c,c',
`b` int(11) DEFAULT NULL `b` int(11) DEFAULT NULL
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `one_or_two`='ttt' `YESNO`=SSS `VAROPT`='5' `ULL`=10000000 ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `one_or_two`='ttt' `YESNO`=SSS `ULL`=10000000
alter table t1 one_or_two=two; alter table t1 one_or_two=two;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `complex`='c,c,c', `a` int(11) DEFAULT NULL `complex`='c,c,c',
`b` int(11) DEFAULT NULL `b` int(11) DEFAULT NULL
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `YESNO`=SSS `VAROPT`='5' `ULL`=10000000 `one_or_two`=two ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `YESNO`=SSS `ULL`=10000000 `one_or_two`=two
drop table t1; drop table t1;
#illegal value error #illegal value error
SET SQL_MODE=''; SET SQL_MODE='';
...@@ -183,11 +183,11 @@ SHOW CREATE TABLE t1; ...@@ -183,11 +183,11 @@ SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=4660 `VAROPT`='5' ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=4660
SET example_varopt_default=33; SET example_varopt_default=33;
select create_options from information_schema.tables where table_schema='test' and table_name='t1'; select create_options from information_schema.tables where table_schema='test' and table_name='t1';
create_options create_options
`ULL`=4660 `VAROPT`='5' `ULL`=4660
ALTER TABLE t1 ULL=DEFAULT; ALTER TABLE t1 ULL=DEFAULT;
Warnings: Warnings:
Note 1105 EXAMPLE DEBUG: ULL 4660 -> 4294967295 Note 1105 EXAMPLE DEBUG: ULL 4660 -> 4294967295
...@@ -195,14 +195,14 @@ SHOW CREATE TABLE t1; ...@@ -195,14 +195,14 @@ SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`='5' ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1
DROP TABLE t1; DROP TABLE t1;
create table t1 (a int) engine=example; create table t1 (a int) engine=example;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`='33' ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`=33
drop table t1; drop table t1;
create table t1 (a int) engine=example varopt=15; create table t1 (a int) engine=example varopt=15;
show create table t1; show create table t1;
...@@ -215,7 +215,7 @@ show create table t1; ...@@ -215,7 +215,7 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`='33' ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`=33
drop table t1; drop table t1;
SET @@SQL_MODE=@OLD_SQL_MODE; SET @@SQL_MODE=@OLD_SQL_MODE;
select 1; select 1;
......
...@@ -14,7 +14,7 @@ show create table t1; ...@@ -14,7 +14,7 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `complex`='c,f,f,f' `invalid`=3 `a` int(11) DEFAULT NULL `complex`='c,f,f,f' `invalid`=3
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=10000 `str`='dskj' `one_or_two`='one' `yesno`=0 `foobar`=barfoo `VAROPT`='5' ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=10000 `str`='dskj' `one_or_two`='one' `yesno`=0 `foobar`=barfoo
show create table t2; show create table t2;
Table Create Table Table Create Table
t2 CREATE TABLE `t2` ( t2 CREATE TABLE `t2` (
...@@ -26,7 +26,7 @@ show create table t1; ...@@ -26,7 +26,7 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `complex`='c,f,f,f' /* `invalid`=3 */ `a` int(11) DEFAULT NULL `complex`='c,f,f,f' /* `invalid`=3 */
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=10000 `str`='dskj' `one_or_two`='one' `yesno`=0 /* `foobar`=barfoo */ `VAROPT`='5' ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=10000 `str`='dskj' `one_or_two`='one' `yesno`=0 /* `foobar`=barfoo */
show create table t2; show create table t2;
Table Create Table Table Create Table
t2 CREATE TABLE `t2` ( t2 CREATE TABLE `t2` (
......
...@@ -5395,6 +5395,7 @@ DROP FUNCTION f1; ...@@ -5395,6 +5395,7 @@ DROP FUNCTION f1;
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1, t2; DROP TABLE t1, t2;
create view v1 as select 1; create view v1 as select 1;
FOUND /mariadb-version/ in v1.frm
drop view v1; drop view v1;
# #
# MDEV-7260: Crash in get_best_combination when executing multi-table # MDEV-7260: Crash in get_best_combination when executing multi-table
......
1;F5502320F8429037B8DAEF761B189D12;770A8A65DA156D24EE2A093277530142 #
2;35B2FF0795FB84BBD666DB8430CA214E;4D92199549E0F2EF009B4160F3582E5528A11A45017F3EF8 # this is a comment
3;7E892875A52C59A3B588306B13C31FBD;B374A26A71490437AA024E4FADD5B497FDFF1A8EA6FF12F6FB65AF2720B59CCF #
4;021B0663D4DD7B54E2EBC852677E40BD;18420B5CBA31CCDFFE9716E91EB61374D05914F3ADE23E03 1;770A8A65DA156D24EE2A093277530142
5;9BF92CEA026CE732DA80821122A8CE97;966050D7777350B6FD5CCB3E5F648DA45C63BEFB6DEDDFA13443F156B7D35C84 2;4D92199549E0F2EF009B4160F3582E5528A11A45017F3EF8
6;BC44D4AFD2D9FCD82A679E4DC6700D06;B5EA210C8C09EF20DB95EC584714A89F # another comment
33;B374A26A71490437AA024E4FADD5B497FDFF1A8EA6FF12F6FB65AF2720B59CCF
4;18420B5CBA31CCDFFE9716E91EB61374D05914F3ADE23E03 --> ignored
5;966050D7777350B6FD5CCB3E5F648DA45C63BEFB6DEDDFA13443F156B7D35C84
6;B5EA210C8C09EF20DB95EC584714A89F # and yet another
...@@ -70,12 +70,6 @@ sub skip_combinations { ...@@ -70,12 +70,6 @@ sub skip_combinations {
unless $::mysqld_variables{'version-ssl-library'} =~ /OpenSSL (\S+)/ unless $::mysqld_variables{'version-ssl-library'} =~ /OpenSSL (\S+)/
and $1 ge "1.0.1"; and $1 ge "1.0.1";
$skip{'include/have_example_key_management_plugin.inc'} = 'no example_key_management_plugin'
unless $ENV{EXAMPLE_KEY_MANAGEMENT_PLUGIN_SO};
$skip{'include/have_file_key_management_plugin.inc'} = 'no file_key_management_plugin'
unless $ENV{FILE_KEY_MANAGEMENT_PLUGIN_SO};
%skip; %skip;
} }
......
...@@ -33,6 +33,7 @@ INSERT INTO t1 VALUES(1,'X',1); ...@@ -33,6 +33,7 @@ INSERT INTO t1 VALUES(1,'X',1);
SET DEBUG_DBUG='+d,crash_after_log_ibuf_upd_inplace'; SET DEBUG_DBUG='+d,crash_after_log_ibuf_upd_inplace';
SELECT b FROM t1 LIMIT 3; SELECT b FROM t1 LIMIT 3;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
FOUND /Wrote log record for ibuf update in place operation/ in my_restart.err
CHECK TABLE t1; CHECK TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
......
call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
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 encrypted=yes encryption_key_id=1;
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=3;
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=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 `encrypted`=yes `encryption_key_id`=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 `encrypted`=yes `encryption_key_id`=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 `encrypted`=yes `encryption_key_id`=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()), -150));
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;
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;
count(*)
5000
select count(*) from innodb_dynamic where c1 < 1500000;
count(*)
5000
select count(*) from innodb_redundant where c1 < 1500000;
count(*)
5000
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;
count(*)
5000
select count(*) from innodb_dynamic where c1 < 1500000;
count(*)
5000
select count(*) from innodb_redundant where c1 < 1500000;
count(*)
5000
alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=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 encrypted=DEFAULT encryption_key_id=DEFAULT;
Warnings:
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
Warning 1478 InnoDB: assuming 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
alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=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
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
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_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_dynamic where c1 < 1500000;
count(*)
5000
select count(*) from innodb_redundant where c1 < 1500000;
count(*)
5000
drop procedure innodb_insert_proc;
drop table innodb_normal;
drop table innodb_compact;
drop table innodb_dynamic;
drop table innodb_redundant;
SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; 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_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=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_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=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_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=3;
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant page_encryption=1 page_encryption_key=4; ERROR HY000: Can't create table `test`.`innodb_dynamic` (errno: 140 "Wrong create options")
SET GLOBAL innodb_default_page_encryption_key = 5; create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33;
create table innodb_defkey(c1 bigint not null, b char(200)) engine=innodb page_encryption=1; create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
set innodb_default_encryption_key_id = 5;
create table innodb_defkey(c1 bigint not null, b char(200)) engine=innodb encrypted=yes;
show create table innodb_defkey; show create table innodb_defkey;
Table Create Table Table Create Table
innodb_defkey CREATE TABLE `innodb_defkey` ( innodb_defkey CREATE TABLE `innodb_defkey` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_encryption`=1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `ENCRYPTION_KEY_ID`=5
show create table innodb_compact; show create table innodb_compact;
Table Create Table Table Create Table
innodb_compact CREATE TABLE `innodb_compact` ( innodb_compact CREATE TABLE `innodb_compact` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `page_encryption`=1 `page_encryption_key`=1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `encrypted`=yes `encryption_key_id`=1
show create table innodb_compressed; show create table innodb_compressed;
Table Create Table Table Create Table
innodb_compressed CREATE TABLE `innodb_compressed` ( innodb_compressed CREATE TABLE `innodb_compressed` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `page_encryption`=1 `page_encryption_key`=2 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `encrypted`=yes `encryption_key_id`=2
show create table innodb_dynamic; show create table innodb_dynamic;
Table Create Table Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` ( innodb_dynamic CREATE TABLE `innodb_dynamic` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `page_encryption`=1 `page_encryption_key`=3 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `encrypted`=yes `encryption_key_id`=33
show create table innodb_redundant; show create table innodb_redundant;
Table Create Table Table Create Table
innodb_redundant CREATE TABLE `innodb_redundant` ( innodb_redundant CREATE TABLE `innodb_redundant` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT `page_encryption`=1 `page_encryption_key`=4 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT `encrypted`=yes `encryption_key_id`=4
create procedure innodb_insert_proc (repeat_count int) create procedure innodb_insert_proc (repeat_count int)
begin begin
declare current_num int; declare current_num int;
...@@ -97,15 +99,12 @@ select count(*) from innodb_defkey t1, innodb_normal t2 where ...@@ -97,15 +99,12 @@ select count(*) from innodb_defkey t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
count(*) count(*)
2000 2000
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_encrypted';
variable_value >= 0 variable_value >= 0
1 1
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_decrypted';
variable_value >= 0 variable_value >= 0
1 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_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
update innodb_normal set c1 = c1 +1; update innodb_normal set c1 = c1 +1;
...@@ -149,37 +148,34 @@ select count(*) from innodb_defkey t1, innodb_normal t2 where ...@@ -149,37 +148,34 @@ select count(*) from innodb_defkey t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
count(*) count(*)
2000 2000
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_encrypted';
variable_value >= 0 variable_value >= 0
1 1
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_decrypted';
variable_value >= 0 variable_value >= 0
1 1
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 encrypted=DEFAULT encryption_key_id=DEFAULT;
variable_value = 0
1
alter table innodb_compact engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT;
show create table innodb_compact; show create table innodb_compact;
Table Create Table Table Create Table
innodb_compact CREATE TABLE `innodb_compact` ( innodb_compact CREATE TABLE `innodb_compact` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
alter table innodb_compressed engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT; alter table innodb_compressed engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_compressed; show create table innodb_compressed;
Table Create Table Table Create Table
innodb_compressed CREATE TABLE `innodb_compressed` ( innodb_compressed CREATE TABLE `innodb_compressed` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
alter table innodb_dynamic engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT; alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_dynamic; show create table innodb_dynamic;
Table Create Table Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` ( innodb_dynamic CREATE TABLE `innodb_dynamic` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
alter table innodb_redundant engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT; alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_redundant; show create table innodb_redundant;
Table Create Table Table Create Table
innodb_redundant CREATE TABLE `innodb_redundant` ( innodb_redundant CREATE TABLE `innodb_redundant` (
...@@ -217,7 +213,7 @@ Table Create Table ...@@ -217,7 +213,7 @@ Table Create Table
innodb_defkey CREATE TABLE `innodb_defkey` ( innodb_defkey CREATE TABLE `innodb_defkey` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_encryption`=1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `ENCRYPTION_KEY_ID`=5
update innodb_normal set c1 = c1 +1; update innodb_normal set c1 = c1 +1;
update innodb_compact set c1 = c1 + 1; update innodb_compact set c1 = c1 + 1;
update innodb_compressed set c1 = c1 + 1; update innodb_compressed set c1 = c1 + 1;
...@@ -251,13 +247,10 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where ...@@ -251,13 +247,10 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
count(*) count(*)
2000 2000
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_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 variable_value = 0
1 1
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_decrypted';
variable_value = 0 variable_value = 0
1 1
drop procedure innodb_insert_proc; drop procedure innodb_insert_proc;
......
...@@ -2,8 +2,8 @@ SET GLOBAL innodb_file_format = `Barracuda`; ...@@ -2,8 +2,8 @@ SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1; 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_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_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=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; create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=2 page_compressed=1;
show warnings; show warnings;
Level Code Message Level Code Message
show create table innodb_normal; show create table innodb_normal;
...@@ -17,13 +17,13 @@ Table Create Table ...@@ -17,13 +17,13 @@ Table Create Table
innodb_compact CREATE TABLE `innodb_compact` ( innodb_compact CREATE TABLE `innodb_compact` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `page_encryption`=1 `page_encryption_key`=1 `page_compressed`=1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `encrypted`=yes `encryption_key_id`=1 `page_compressed`=1
show create table innodb_dynamic; show create table innodb_dynamic;
Table Create Table Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` ( innodb_dynamic CREATE TABLE `innodb_dynamic` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `page_encryption`=1 `page_encryption_key`=2 `page_compressed`=1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `encrypted`=yes `encryption_key_id`=2 `page_compressed`=1
create procedure innodb_insert_proc (repeat_count int) create procedure innodb_insert_proc (repeat_count int)
begin begin
declare current_num int; declare current_num int;
...@@ -60,21 +60,16 @@ select count(*) from innodb_dynamic t1, innodb_normal t2 where ...@@ -60,21 +60,16 @@ select count(*) from innodb_dynamic t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
count(*) count(*)
5000 5000
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_encrypted';
variable_value >= 0 variable_value >= 0
1 1
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_decrypted';
variable_value >= 0 variable_value >= 0
1 1
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_compressed';
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 variable_value >= 0
1 SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decompressed';
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed';
variable_value >= 0 variable_value >= 0
1
SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1; set global innodb_compression_algorithm = 1;
...@@ -98,21 +93,16 @@ select count(*) from innodb_dynamic t1, innodb_normal t2 where ...@@ -98,21 +93,16 @@ select count(*) from innodb_dynamic t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
count(*) count(*)
5000 5000
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_encrypted';
variable_value >= 0 variable_value >= 0
1 1
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_decrypted';
variable_value >= 0 variable_value >= 0
1 1
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_compressed';
variable_value = 0 variable_value >= 0
1 SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decompressed';
SELECT variable_value > 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_compressed'; variable_value >= 0
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
alter table innodb_normal engine=innodb page_compressed=DEFAULT; alter table innodb_normal engine=innodb page_compressed=DEFAULT;
show create table innodb_normal; show create table innodb_normal;
Table Create Table Table Create Table
...@@ -120,14 +110,14 @@ innodb_normal CREATE TABLE `innodb_normal` ( ...@@ -120,14 +110,14 @@ innodb_normal CREATE TABLE `innodb_normal` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
alter table innodb_compact engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT page_compressed=DEFAULT; alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT page_compressed=DEFAULT;
show create table innodb_compact; show create table innodb_compact;
Table Create Table Table Create Table
innodb_compact CREATE TABLE `innodb_compact` ( innodb_compact CREATE TABLE `innodb_compact` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
alter table innodb_dynamic engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT page_compressed=DEFAULT; alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT page_compressed=DEFAULT;
show create table innodb_dynamic; show create table innodb_dynamic;
Table Create Table Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` ( innodb_dynamic CREATE TABLE `innodb_dynamic` (
...@@ -174,21 +164,16 @@ select count(*) from innodb_dynamic t1, innodb_normal t2 where ...@@ -174,21 +164,16 @@ select count(*) from innodb_dynamic t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
count(*) count(*)
5000 5000
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_encrypted';
variable_value = 0 variable_value = 0
1 1
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_decrypted';
variable_value = 0 variable_value = 0
1 1
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_compressed';
variable_value = 0 variable_value = 0
1 SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decompressed';
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_compressed';
variable_value = 0 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 procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
drop table innodb_compact; drop table innodb_compact;
......
...@@ -4,34 +4,34 @@ call mtr.add_suppression("InnoDB: Redo log crypto: Can't initialize to key versi ...@@ -4,34 +4,34 @@ call mtr.add_suppression("InnoDB: Redo log crypto: Can't initialize to key versi
SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; 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_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=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_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=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_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33;
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant page_encryption=1 page_encryption_key=4; create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
show create table innodb_compact; show create table innodb_compact;
Table Create Table Table Create Table
innodb_compact CREATE TABLE `innodb_compact` ( innodb_compact CREATE TABLE `innodb_compact` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `page_encryption`=1 `page_encryption_key`=1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `encrypted`=yes `encryption_key_id`=1
show create table innodb_compressed; show create table innodb_compressed;
Table Create Table Table Create Table
innodb_compressed CREATE TABLE `innodb_compressed` ( innodb_compressed CREATE TABLE `innodb_compressed` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `page_encryption`=1 `page_encryption_key`=2 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `encrypted`=yes `encryption_key_id`=2
show create table innodb_dynamic; show create table innodb_dynamic;
Table Create Table Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` ( innodb_dynamic CREATE TABLE `innodb_dynamic` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `page_encryption`=1 `page_encryption_key`=3 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `encrypted`=yes `encryption_key_id`=33
show create table innodb_redundant; show create table innodb_redundant;
Table Create Table Table Create Table
innodb_redundant CREATE TABLE `innodb_redundant` ( innodb_redundant CREATE TABLE `innodb_redundant` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT `page_encryption`=1 `page_encryption_key`=4 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT `encrypted`=yes `encryption_key_id`=4
create procedure innodb_insert_proc (repeat_count int) create procedure innodb_insert_proc (repeat_count int)
begin begin
declare current_num int; declare current_num int;
...@@ -83,15 +83,12 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where ...@@ -83,15 +83,12 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
count(*) count(*)
2000 2000
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_encrypted';
variable_value >= 0 variable_value >= 0
1 1
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_decrypted';
variable_value >= 0 variable_value >= 0
1 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_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
update innodb_normal set c1 = c1 +1; update innodb_normal set c1 = c1 +1;
...@@ -127,37 +124,34 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where ...@@ -127,37 +124,34 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
count(*) count(*)
2000 2000
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_encrypted';
variable_value >= 0 variable_value >= 0
1 1
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_decrypted';
variable_value >= 0 variable_value >= 0
1 1
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 encrypted=DEFAULT encryption_key_id=DEFAULT;
variable_value = 0
1
alter table innodb_compact engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT;
show create table innodb_compact; show create table innodb_compact;
Table Create Table Table Create Table
innodb_compact CREATE TABLE `innodb_compact` ( innodb_compact CREATE TABLE `innodb_compact` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
alter table innodb_compressed engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT; alter table innodb_compressed engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_compressed; show create table innodb_compressed;
Table Create Table Table Create Table
innodb_compressed CREATE TABLE `innodb_compressed` ( innodb_compressed CREATE TABLE `innodb_compressed` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
alter table innodb_dynamic engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT; alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_dynamic; show create table innodb_dynamic;
Table Create Table Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` ( innodb_dynamic CREATE TABLE `innodb_dynamic` (
`c1` bigint(20) NOT NULL, `c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
alter table innodb_redundant engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT; alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_redundant; show create table innodb_redundant;
Table Create Table Table Create Table
innodb_redundant CREATE TABLE `innodb_redundant` ( innodb_redundant CREATE TABLE `innodb_redundant` (
...@@ -223,13 +217,10 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where ...@@ -223,13 +217,10 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
count(*) count(*)
2000 2000
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_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 variable_value = 0
1 1
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_decrypted';
variable_value = 0 variable_value = 0
1 1
drop procedure innodb_insert_proc; drop procedure innodb_insert_proc;
......
SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1; set global innodb_compression_algorithm = 1;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb page_compressed=1;
ERROR HY000: Can't create table `test`.`innodb_normal` (errno: 140 "Wrong create options")
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact page_compressed=1;
ERROR HY000: Can't create table `test`.`innodb_compact` (errno: 140 "Wrong create options")
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_compressed=1;
ERROR HY000: Can't create table `test`.`innodb_dynamic` (errno: 140 "Wrong create options")
SET @start_global_value = @@global.innodb_encryption_threads; SET @start_global_value = @@global.innodb_encryption_threads;
SHOW VARIABLES LIKE 'innodb_encrypt%'; SHOW VARIABLES LIKE 'innodb_encrypt%';
Variable_name Value Variable_name Value
innodb_encrypt_log OFF innodb_encrypt_log ON
innodb_encrypt_tables ON innodb_encrypt_tables ON
innodb_encryption_rotate_key_age 15 innodb_encryption_rotate_key_age 15
innodb_encryption_rotation_iops 100 innodb_encryption_rotation_iops 100
...@@ -44,7 +44,7 @@ SET GLOBAL innodb_encryption_threads=@start_global_value; ...@@ -44,7 +44,7 @@ SET GLOBAL innodb_encryption_threads=@start_global_value;
# Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0 # Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
SHOW VARIABLES LIKE 'innodb_encrypt%'; SHOW VARIABLES LIKE 'innodb_encrypt%';
Variable_name Value Variable_name Value
innodb_encrypt_log OFF innodb_encrypt_log ON
innodb_encrypt_tables OFF innodb_encrypt_tables OFF
innodb_encryption_rotate_key_age 15 innodb_encryption_rotate_key_age 15
innodb_encryption_rotation_iops 100 innodb_encryption_rotation_iops 100
......
show variables like 'innodb_encrypt%';
Variable_name Value
innodb_encrypt_log ON
innodb_encrypt_tables ON
innodb_encryption_rotate_key_age 2
innodb_encryption_rotation_iops 100
innodb_encryption_threads 4
select space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space;
space name current_key_version
0 NULL 1
1 mysql/innodb_table_stats 1
2 mysql/innodb_index_stats 1
set global debug_key_management_version=10;
select space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space;
space name current_key_version
0 NULL 10
1 mysql/innodb_table_stats 10
2 mysql/innodb_index_stats 10
set global debug_key_management_version=1;
select @@innodb_encrypt_tables;
@@innodb_encrypt_tables
FORCE
create table t1 (a int) engine=innodb encrypted=yes;
create table t2 (a int) engine=innodb encrypted=default;
create table t3 (a int) engine=innodb encrypted=no;
ERROR HY000: Can't create table `test`.`t3` (errno: 140 "Wrong create options")
set global innodb_encrypt_tables='ON';
create table t3 (a int) engine=innodb encrypted=no;
set global innodb_encrypt_tables='FORCE';
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=no
alter table t1 encrypted=no;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
alter table t2 encrypted=yes;
alter table t3 encrypted=default;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
drop table t2;
drop table t3;
...@@ -91,15 +91,12 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where ...@@ -91,15 +91,12 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
count(*) count(*)
2000 2000
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_encrypted';
variable_value >= 0 variable_value >= 0
1 1
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_decrypted';
variable_value >= 0 variable_value >= 0
1 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'; SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_compressed';
variable_value >= 0 variable_value >= 0
1 1
...@@ -144,21 +141,18 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where ...@@ -144,21 +141,18 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
count(*) count(*)
2000 2000
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_encrypted';
variable_value >= 0
1
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decrypted';
variable_value >= 0 variable_value >= 0
1 1
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_compressed';
variable_value >= 0 variable_value >= 0
1 1
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_decompressed';
variable_value = 0 variable_value >= 0
1 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
0
drop procedure innodb_insert_proc; drop procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
drop table innodb_compact; drop table innodb_compact;
......
...@@ -180,9 +180,8 @@ compress_page_compressed_trim_op disabled ...@@ -180,9 +180,8 @@ 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_encrypted disabled
compress_pages_page_decrypted disabled compress_pages_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
......
--source include/no_valgrind_without_big.inc --source include/no_valgrind_without_big.inc
--source include/not_embedded.inc
# Tests for setting innodb-page-size=32k; # Tests for setting innodb-page-size=32k;
--source include/have_xtradb.inc --source include/have_innodb.inc
--source include/have_innodb_32k.inc --source include/have_innodb_32k.inc
--source include/have_file_key_management_plugin.inc
call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *"); call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
...@@ -15,9 +17,9 @@ SET GLOBAL innodb_file_format = `Barracuda`; ...@@ -15,9 +17,9 @@ SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; 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_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=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_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=3;
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant page_encryption=1 page_encryption_key=4; create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
show create table innodb_compact; show create table innodb_compact;
show create table innodb_dynamic; show create table innodb_dynamic;
...@@ -61,11 +63,11 @@ select count(*) from innodb_compact where c1 < 1500000; ...@@ -61,11 +63,11 @@ select count(*) from innodb_compact where c1 < 1500000;
select count(*) from innodb_dynamic where c1 < 1500000; select count(*) from innodb_dynamic where c1 < 1500000;
select count(*) from innodb_redundant where c1 < 1500000; select count(*) from innodb_redundant where c1 < 1500000;
alter table innodb_compact engine=innodb page_encryption=0; alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_compact; show create table innodb_compact;
alter table innodb_dynamic engine=innodb page_encryption=0; alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_dynamic; show create table innodb_dynamic;
alter table innodb_redundant engine=innodb page_encryption=0; alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_redundant; show create table innodb_redundant;
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
......
...@@ -4,20 +4,21 @@ ...@@ -4,20 +4,21 @@
--disable_query_log --disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`; let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`; let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
let $default_page_encryption_key = `SELECT @@innodb_default_page_encryption_key`;
--enable_query_log --enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; 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_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=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_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=2;
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_encryption=1 page_encryption_key=3; --error ER_CANT_CREATE_TABLE
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant page_encryption=1 page_encryption_key=4; create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=3;
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33;
SET GLOBAL innodb_default_page_encryption_key = 5; create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
create table innodb_defkey(c1 bigint not null, b char(200)) engine=innodb page_encryption=1;
set innodb_default_encryption_key_id = 5;
create table innodb_defkey(c1 bigint not null, b char(200)) engine=innodb encrypted=yes;
show create table innodb_defkey; show create table innodb_defkey;
show create table innodb_compact; show create table innodb_compact;
...@@ -73,9 +74,8 @@ select count(*) from innodb_defkey t1, innodb_normal t2 where ...@@ -73,9 +74,8 @@ select count(*) from innodb_defkey t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
# Note there that these variables are updated only when real I/O is done, thus they are not reliable # 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_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_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 --source include/restart_mysqld.inc
...@@ -104,17 +104,16 @@ t1.c1 = t2.c1 and t1.b = t2.b; ...@@ -104,17 +104,16 @@ t1.c1 = t2.c1 and t1.b = t2.b;
select count(*) from innodb_defkey t1, innodb_normal t2 where select count(*) from innodb_defkey t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
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_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_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; alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_compact; show create table innodb_compact;
alter table innodb_compressed engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT; alter table innodb_compressed engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_compressed; show create table innodb_compressed;
alter table innodb_dynamic engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT; alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_dynamic; show create table innodb_dynamic;
alter table innodb_redundant engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT; alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_redundant; show create table innodb_redundant;
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
...@@ -147,9 +146,8 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where ...@@ -147,9 +146,8 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
# After alter+restart these should be 0 # 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_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_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 procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
...@@ -163,5 +161,4 @@ drop table innodb_defkey; ...@@ -163,5 +161,4 @@ drop table innodb_defkey;
--disable_query_log --disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig; EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig; EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
EVAL SET GLOBAL innodb_default_page_encryption_key = $default_page_encryption_key;
--enable_query_log --enable_query_log
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/not_embedded.inc
-- source include/have_file_key_management_plugin.inc -- source include/have_file_key_management_plugin.inc
--disable_query_log --disable_query_log
...@@ -13,8 +14,8 @@ SET GLOBAL innodb_file_per_table = ON; ...@@ -13,8 +14,8 @@ SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1; 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_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_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=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; create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=2 page_compressed=1;
show warnings; show warnings;
show create table innodb_normal; show create table innodb_normal;
...@@ -53,11 +54,10 @@ t1.c1 = t2.c1 and t1.b = t2.b; ...@@ -53,11 +54,10 @@ t1.c1 = t2.c1 and t1.b = t2.b;
select count(*) from innodb_dynamic t1, innodb_normal t2 where select count(*) from innodb_dynamic t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
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_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_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_compressed';
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_decompressed';
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed';
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
...@@ -77,17 +77,16 @@ t1.c1 = t2.c1 and t1.b = t2.b; ...@@ -77,17 +77,16 @@ t1.c1 = t2.c1 and t1.b = t2.b;
select count(*) from innodb_dynamic t1, innodb_normal t2 where select count(*) from innodb_dynamic t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
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_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_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_compressed';
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_decompressed';
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; alter table innodb_normal engine=innodb page_compressed=DEFAULT;
show create table innodb_normal; show create table innodb_normal;
alter table innodb_compact engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT page_compressed=DEFAULT; alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT page_compressed=DEFAULT;
show create table innodb_compact; show create table innodb_compact;
alter table innodb_dynamic engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT page_compressed=DEFAULT; alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT page_compressed=DEFAULT;
show create table innodb_dynamic; show create table innodb_dynamic;
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
...@@ -110,11 +109,10 @@ t1.c1 = t2.c1 and t1.b = t2.b; ...@@ -110,11 +109,10 @@ t1.c1 = t2.c1 and t1.b = t2.b;
select count(*) from innodb_dynamic t1, innodb_normal t2 where select count(*) from innodb_dynamic t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
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_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_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_compressed';
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_decompressed';
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed';
drop procedure innodb_insert_proc; drop procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
......
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/not_embedded.inc
-- source include/have_file_key_management_plugin.inc -- source include/have_file_key_management_plugin.inc
--disable_query_log --disable_query_log
...@@ -14,10 +15,10 @@ SET GLOBAL innodb_file_format = `Barracuda`; ...@@ -14,10 +15,10 @@ SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; 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_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=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_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=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_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33;
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant page_encryption=1 page_encryption_key=4; create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
show create table innodb_compact; show create table innodb_compact;
show create table innodb_compressed; show create table innodb_compressed;
...@@ -66,9 +67,8 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where ...@@ -66,9 +67,8 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
# Note there that these variables are updated only when real I/O is done, thus they are not reliable # 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_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_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 --source include/restart_mysqld.inc
...@@ -93,17 +93,16 @@ t1.c1 = t2.c1 and t1.b = t2.b; ...@@ -93,17 +93,16 @@ t1.c1 = t2.c1 and t1.b = t2.b;
select count(*) from innodb_redundant t1, innodb_normal t2 where select count(*) from innodb_redundant t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
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_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_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; alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_compact; show create table innodb_compact;
alter table innodb_compressed engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT; alter table innodb_compressed engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_compressed; show create table innodb_compressed;
alter table innodb_dynamic engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT; alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_dynamic; show create table innodb_dynamic;
alter table innodb_redundant engine=innodb page_encryption=DEFAULT page_encryption_key=DEFAULT; alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
show create table innodb_redundant; show create table innodb_redundant;
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
...@@ -135,9 +134,8 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where ...@@ -135,9 +134,8 @@ select count(*) from innodb_redundant t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
# After alter+restart these should be 0 # 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_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_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 procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
......
--aria-encrypt-tables=ON --aria-encrypt-tables=ON
--encrypt-tmp-disk-tables=ON --encrypt-tmp-disk-tables=ON
--innodb-encrypt-tables=ON --innodb-encrypt-tables=ON
--innodb-encrypt-log=ON
--innodb-encryption-rotate-key-age=15 --innodb-encryption-rotate-key-age=15
--innodb-encryption-threads=4 --innodb-encryption-threads=4
--innodb-tablespaces-encryption --innodb-tablespaces-encryption
...@@ -15,16 +15,6 @@ SET GLOBAL innodb_file_per_table = ON; ...@@ -15,16 +15,6 @@ SET GLOBAL innodb_file_per_table = ON;
# zlib # zlib
set global innodb_compression_algorithm = 1; set global innodb_compression_algorithm = 1;
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
--error 1005
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb page_compressed=1;
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
--error 1005
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact page_compressed=1;
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
--error 1005
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_compressed=1;
# reset system # reset system
--disable_query_log --disable_query_log
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig; EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig;
......
--aria-encrypt-tables=ON --aria-encrypt-tables=ON
--encrypt-tmp-disk-tables=ON --encrypt-tmp-disk-tables=ON
--innodb-encrypt-tables=ON --innodb-encrypt-tables=ON
--innodb-encrypt-log=ON
--innodb-encryption-rotate-key-age=15 --innodb-encryption-rotate-key-age=15
--innodb-encryption-threads=4 --innodb-encryption-threads=4
--innodb-tablespaces-encryption --innodb-tablespaces-encryption
......
--innodb-encrypt-tables=ON
--innodb-encrypt-log=ON
--innodb-encryption-rotate-key-age=2
--innodb-encryption-threads=4
--innodb-tablespaces-encryption
--plugin-load-add=$DEBUG_KEY_MANAGEMENT_SO
-- source include/have_innodb.inc
if (`select count(*) = 0 from information_schema.plugins
where plugin_name = 'debug_key_management' and plugin_status='active'`)
{
--skip Needs debug_key_management
}
show variables like 'innodb_encrypt%';
let $wait_condition= select count(*) = 3 from information_schema.innodb_tablespaces_encryption where current_key_version=1;
--source include/wait_condition.inc
select space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space;
set global debug_key_management_version=10;
let $wait_condition= select count(*) = 3 from information_schema.innodb_tablespaces_encryption where current_key_version=10;
--source include/wait_condition.inc
select space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space;
set global debug_key_management_version=1;
--innodb-encrypt-tables=FORCE
--innodb-encrypt-log=ON
-- source include/have_innodb.inc
-- source include/have_example_key_management_plugin.inc
select @@innodb_encrypt_tables;
create table t1 (a int) engine=innodb encrypted=yes;
create table t2 (a int) engine=innodb encrypted=default;
--error ER_CANT_CREATE_TABLE
create table t3 (a int) engine=innodb encrypted=no;
set global innodb_encrypt_tables='ON';
create table t3 (a int) engine=innodb encrypted=no;
set global innodb_encrypt_tables='FORCE';
show create table t1;
show create table t2;
show create table t3;
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
--error ER_CANT_CREATE_TABLE
alter table t1 encrypted=no;
alter table t2 encrypted=yes;
alter table t3 encrypted=default;
show create table t1;
show create table t2;
show create table t3;
drop table t1;
drop table t2;
drop table t3;
--aria-encrypt-tables=ON --aria-encrypt-tables=ON
--encrypt-tmp-disk-tables=ON --encrypt-tmp-disk-tables=ON
--innodb-encrypt-tables=ON --innodb-encrypt-tables=ON
--innodb-encrypt-log=ON
--innodb-encryption-rotate-key-age=15 --innodb-encryption-rotate-key-age=15
--innodb-encryption-threads=4 --innodb-encryption-threads=4
--innodb-tablespaces-encryption --innodb-tablespaces-encryption
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/have_example_key_management_plugin.inc -- source include/have_example_key_management_plugin.inc
--source include/not_embedded.inc -- source include/not_embedded.inc
--disable_query_log --disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`; let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
...@@ -66,9 +66,8 @@ t1.c1 = t2.c1 and t1.b = t2.b; ...@@ -66,9 +66,8 @@ t1.c1 = t2.c1 and t1.b = t2.b;
select count(*) from innodb_redundant t1, innodb_normal t2 where select count(*) from innodb_redundant t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
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_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_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_compressed';
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed'; SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed';
...@@ -96,11 +95,10 @@ t1.c1 = t2.c1 and t1.b = t2.b; ...@@ -96,11 +95,10 @@ t1.c1 = t2.c1 and t1.b = t2.b;
select count(*) from innodb_redundant t1, innodb_normal t2 where select count(*) from innodb_redundant t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b; t1.c1 = t2.c1 and t1.b = t2.b;
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_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_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_compressed'; SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed';
SELECT variable_value > 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed';
drop procedure innodb_insert_proc; drop procedure innodb_insert_proc;
drop table innodb_normal; drop table innodb_normal;
......
...@@ -2,12 +2,11 @@ ...@@ -2,12 +2,11 @@
--encrypt-tmp-disk-tables=ON --encrypt-tmp-disk-tables=ON
--innodb-background-scrub-data-compressed=OFF --innodb-background-scrub-data-compressed=OFF
--innodb-background-scrub-data-uncompressed=OFF --innodb-background-scrub-data-uncompressed=OFF
--innodb-encrypt-tables=0
--innodb-encrypt-tables=ON --innodb-encrypt-tables=ON
--innodb-encrypt-log=ON
--innodb-encryption-rotate-key-age=15 --innodb-encryption-rotate-key-age=15
--innodb-encryption-threads=0
--innodb-encryption-threads=4 --innodb-encryption-threads=4
--innodb-file-format=Barracuda --innodb-file-format=Barracuda
--innodb-file-per-table=1 --innodb-file-per-table=1
--innodb-immediate-scrub-data-uncompressed=ON --innodb-immediate-scrub-data-uncompressed=ON
--loose-innodb-scrub-force-testing=ON --loose-innodb-debug-force-scrubbing=ON
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/not_embedded.inc -- source include/not_embedded.inc
-- source include/have_example_key_management_plugin.inc -- source include/have_example_key_management_plugin.inc
-- source include/not_windows.inc
let $MYSQLD_DATADIR=`select @@datadir`; let $MYSQLD_DATADIR=`select @@datadir`;
let ib1_IBD = $MYSQLD_DATADIR/ibdata1; let ib1_IBD = $MYSQLD_DATADIR/ibdata1;
......
--innodb-file-per-table=1 --innodb-file-per-table=1
--innodb-file-format=Barracuda --innodb-file-format=Barracuda
--innodb-encrypt-tables=0
--innodb-encryption-threads=0
--innodb-immediate-scrub-data-uncompressed=OFF --innodb-immediate-scrub-data-uncompressed=OFF
--innodb-background-scrub-data-uncompressed=ON --innodb-background-scrub-data-uncompressed=ON
--innodb-background-scrub-data-compressed=ON --innodb-background-scrub-data-compressed=ON
--loose-innodb-scrub-force-testing=ON --loose-innodb-debug-force-scrubbing=ON
--encrypt-tmp-disk-tables=ON --encrypt-tmp-disk-tables=ON
--aria-encrypt-tables=ON --aria-encrypt-tables=ON
--innodb-encryption-threads=4 --innodb-encryption-threads=4
--innodb-encryption-rotate-key-age=15 --innodb-encryption-rotate-key-age=15
--innodb-encrypt-tables=ON --innodb-encrypt-tables=ON
--innodb-encrypt-log=ON
--innodb-tablespaces-scrubbing --innodb-tablespaces-scrubbing
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/not_embedded.inc -- source include/not_embedded.inc
-- source include/have_example_key_management_plugin.inc -- source include/have_example_key_management_plugin.inc
-- source include/not_windows.inc
let $MYSQLD_DATADIR=`select @@datadir`; let $MYSQLD_DATADIR=`select @@datadir`;
let ib1_IBD = $MYSQLD_DATADIR/ibdata1; let ib1_IBD = $MYSQLD_DATADIR/ibdata1;
......
--innodb-file-per-table=1 --innodb-file-per-table=1
--innodb-file-format=Barracuda --innodb-file-format=Barracuda
--innodb-encrypt-tables=off
--innodb-immediate-scrub-data-uncompressed=ON --innodb-immediate-scrub-data-uncompressed=ON
--innodb-background-scrub-data-uncompressed=ON --innodb-background-scrub-data-uncompressed=ON
--innodb-background-scrub-data-compressed=ON --innodb-background-scrub-data-compressed=ON
--loose-innodb-scrub-force-testing=ON --loose-innodb-debug-force-scrubbing=ON
--innodb-encryption-threads=0
--encrypt-tmp-disk-tables=ON --encrypt-tmp-disk-tables=ON
--aria-encrypt-tables=ON --aria-encrypt-tables=ON
--innodb-encryption-threads=4 --innodb-encryption-threads=4
--innodb-encryption-rotate-key-age=15 --innodb-encryption-rotate-key-age=15
--innodb-encrypt-tables=ON --innodb-encrypt-tables=ON
--innodb-encrypt-log=ON
--innodb-tablespaces-scrubbing --innodb-tablespaces-scrubbing
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/not_embedded.inc -- source include/not_embedded.inc
-- source include/have_example_key_management_plugin.inc -- source include/have_example_key_management_plugin.inc
-- source include/not_windows.inc
let $MYSQLD_DATADIR=`select @@datadir`; let $MYSQLD_DATADIR=`select @@datadir`;
let ib1_IBD = $MYSQLD_DATADIR/ibdata1; let ib1_IBD = $MYSQLD_DATADIR/ibdata1;
......
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=1
insert t1 values (12345, repeat('1234567890', 20));
alter table t1 encryption_key_id=2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2
alter table t1 encryption_key_id=3;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2
alter table t1 encryption_key_id=33;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=33
alter table t1 encryption_key_id=4;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=4
drop table t1;
call mtr.add_suppression("Cannot decrypt .*filekeys-data.enc. Wrong key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Cannot decrypt .*filekeys-data.enc. Wrong key/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
call mtr.add_suppression("File 'bad' not found");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /File 'bad' not found/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=1
insert t1 values (12345, repeat('1234567890', 20));
alter table t1 encryption_key_id=2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2
alter table t1 encryption_key_id=3;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2
alter table t1 encryption_key_id=33;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=33
alter table t1 encryption_key_id=4;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=4
drop table t1;
call mtr.add_suppression("Cannot decrypt .*filekeys-data.enc. Wrong key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Cannot decrypt .*filekeys-data.enc. Wrong key/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
call mtr.add_suppression("File '' not found");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /File '' not found/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
call mtr.add_suppression("File '.*keys.txt' not found");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /File '.*keys.txt' not found/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
install soname 'file_key_management';
ERROR HY000: Invalid key id at MYSQL_TMP_DIR/keys.txt line 2, column 2
call mtr.add_suppression("File '.*keys.txt' not found");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /File '.*keys.txt' not found/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
call mtr.add_suppression("Invalid key id");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key id/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
install soname 'file_key_management';
ERROR HY000: Invalid key id at MYSQL_TMP_DIR/keys.txt line 2, column 11
call mtr.add_suppression("Invalid key id");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key id/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
call mtr.add_suppression("Invalid key id");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key id/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
install soname 'file_key_management';
ERROR HY000: Invalid key at MYSQL_TMP_DIR/keys.txt line 2, column 47
call mtr.add_suppression("Invalid key id");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key id/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
call mtr.add_suppression("Invalid key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
install soname 'file_key_management';
ERROR HY000: Invalid key at MYSQL_TMP_DIR/keys.txt line 2, column 33
call mtr.add_suppression("Invalid key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
call mtr.add_suppression("Invalid key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
install soname 'file_key_management';
ERROR HY000: Syntax error at MYSQL_TMP_DIR/keys.txt line 2, column 2
call mtr.add_suppression("Invalid key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
call mtr.add_suppression("Syntax error");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Syntax error/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
install soname 'file_key_management';
ERROR HY000: Syntax error at MYSQL_TMP_DIR/keys.txt line 2, column 1
call mtr.add_suppression("Syntax error");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Syntax error/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
call mtr.add_suppression("Syntax error");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Syntax error/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
call mtr.add_suppression("Cannot decrypt .*keys.txt. Not encrypted");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Cannot decrypt .*keys.txt. Not encrypted/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
...@@ -21,7 +21,7 @@ Name Status Type Library License ...@@ -21,7 +21,7 @@ Name Status Type Library License
EXAMPLE NOT INSTALLED STORAGE ENGINE ha_example.so GPL EXAMPLE NOT INSTALLED STORAGE ENGINE ha_example.so GPL
UNUSABLE NOT INSTALLED DAEMON ha_example.so GPL UNUSABLE NOT INSTALLED DAEMON ha_example.so GPL
daemon_example NOT INSTALLED DAEMON libdaemon_example.so GPL daemon_example NOT INSTALLED DAEMON libdaemon_example.so GPL
example_key_management_plugin NOT INSTALLED ENCRYPTION KEY MANAGEMENT example_key_management_plugin.so GPL example_key_management NOT INSTALLED ENCRYPTION example_key_management.so GPL
three_attempts NOT INSTALLED AUTHENTICATION dialog_examples.so GPL three_attempts NOT INSTALLED AUTHENTICATION dialog_examples.so GPL
two_questions NOT INSTALLED AUTHENTICATION dialog_examples.so GPL two_questions NOT INSTALLED AUTHENTICATION dialog_examples.so GPL
show status like '%libraries%'; show status like '%libraries%';
......
secret
\ No newline at end of file
-- source include/not_embedded.inc
-- source include/have_xtradb.inc
-- source filekeys_plugin.inc
--eval call mtr.add_suppression("$SEARCH_PATTERN")
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
--let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err
--let SEARCH_RANGE= -10000
--source include/search_pattern_in_file.inc
--error ER_CANT_CREATE_TABLE
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
--loose-file-key-management-filekey=secret
--loose-file-key-management-filename=$MTR_SUITE_DIR/t/filekeys-data.enc
--loose-file-key-management-filekey=bad
--loose-file-key-management-filename=$MTR_SUITE_DIR/t/filekeys-data.enc
let SEARCH_PATTERN=Cannot decrypt .*filekeys-data.enc. Wrong key;
source filekeys_badtest.inc;
--loose-file-key-management-filekey=FILE:bad
--loose-file-key-management-filename=$MTR_SUITE_DIR/t/filekeys-data.enc
let SEARCH_PATTERN=File 'bad' not found;
source filekeys_badtest.inc;
--loose-file-key-management-filekey=FILE:$MTR_SUITE_DIR/t/filekeys-data.key
--loose-file-key-management-filename=$MTR_SUITE_DIR/t/filekeys-data.enc
--loose-file-key-management-filename=$MTR_SUITE_DIR/t/filekeys-data.enc
let SEARCH_PATTERN=Cannot decrypt .*filekeys-data.enc. Wrong key;
source filekeys_badtest.inc;
-- source include/have_xtradb.inc
-- source filekeys_plugin.inc
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
show create table t1;
insert t1 values (12345, repeat('1234567890', 20));
alter table t1 encryption_key_id=2;
show create table t1;
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
--error ER_CANT_CREATE_TABLE
alter table t1 encryption_key_id=3;
show create table t1;
alter table t1 encryption_key_id=33;
show create table t1;
alter table t1 encryption_key_id=4;
show create table t1;
drop table t1;
let SEARCH_PATTERN=File '' not found;
source filekeys_badtest.inc;
if (!$FILE_KEY_MANAGEMENT_SO)
{
--skip Needs file_key_management
}
--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
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