summaryrefslogtreecommitdiff
path: root/storage/xtradb/dict
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2015-08-14 11:09:06 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2015-08-14 16:25:18 +0300
commitbfb6ea02321f963c2b5f5beb333283585d3d1be3 (patch)
tree1de9aa594dbefd0ce33301ec00833b442e9658af /storage/xtradb/dict
parenta80753594a37538a35df7c02ae80da624578dec4 (diff)
downloadmariadb-git-bfb6ea02321f963c2b5f5beb333283585d3d1be3.tar.gz
MDEV-8589: Non-default ENCRYPTION_KEY_ID is ignored upon reading a table
Analysis: Problem was that when a new tablespace is created a default encryption info is also created and stored to the tablespace. Later a new encryption information was created with correct key_id but that does not affect on IV. Fix: Push encryption mode and key_id to lower levels and create correct encryption info when a new tablespace is created. This fix does not contain test case because, currently incorrect encryption key causes page corruption and a lot of error messages to error log causing mtr to fail.
Diffstat (limited to 'storage/xtradb/dict')
-rw-r--r--storage/xtradb/dict/dict0crea.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/storage/xtradb/dict/dict0crea.cc b/storage/xtradb/dict/dict0crea.cc
index 30523ff2af4..36a30cb75b7 100644
--- a/storage/xtradb/dict/dict0crea.cc
+++ b/storage/xtradb/dict/dict0crea.cc
@@ -309,7 +309,8 @@ dict_build_table_def_step(
space, table->name, path,
dict_tf_to_fsp_flags(table->flags),
table->flags2,
- FIL_IBD_FILE_INITIAL_SIZE);
+ FIL_IBD_FILE_INITIAL_SIZE,
+ node->mode, node->key_id);
table->space = (unsigned int) space;
@@ -934,8 +935,10 @@ tab_create_graph_create(
dict_table_t* table, /*!< in: table to create, built as a memory data
structure */
mem_heap_t* heap, /*!< in: heap where created */
- bool commit) /*!< in: true if the commit node should be
+ bool commit, /*!< in: true if the commit node should be
added to the query graph */
+ fil_encryption_t mode, /*!< in: encryption mode */
+ ulint key_id) /*!< in: encryption key_id */
{
tab_node_t* node;
@@ -948,6 +951,8 @@ tab_create_graph_create(
node->state = TABLE_BUILD_TABLE_DEF;
node->heap = mem_heap_create(256);
+ node->mode = mode;
+ node->key_id = key_id;
node->tab_def = ins_node_create(INS_DIRECT, dict_sys->sys_tables,
heap);
@@ -1042,7 +1047,6 @@ dict_create_table_step(
/* DO THE CHECKS OF THE CONSISTENCY CONSTRAINTS HERE */
err = dict_build_table_def_step(thr, node);
-
if (err != DB_SUCCESS) {
goto function_exit;