diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2016-03-18 11:48:49 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2016-03-18 11:48:49 +0200 |
commit | ee768d8e0e17b655f8f51bc631fb77c68f48c722 (patch) | |
tree | bab9faa261c1688ce83b264542e48fa748702f57 /storage/xtradb | |
parent | 4aac51db9a55a11574cbfa60484d4329d35b6f2c (diff) | |
download | mariadb-git-ee768d8e0e17b655f8f51bc631fb77c68f48c722.tar.gz |
MDEV-9640: Add used key_id to INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
Diffstat (limited to 'storage/xtradb')
-rw-r--r-- | storage/xtradb/fil/fil0crypt.cc | 3 | ||||
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 21 | ||||
-rw-r--r-- | storage/xtradb/handler/i_s.cc | 13 | ||||
-rw-r--r-- | storage/xtradb/include/fil0crypt.h | 1 |
4 files changed, 25 insertions, 13 deletions
diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc index 79a2eca56d5..ceffa950739 100644 --- a/storage/xtradb/fil/fil0crypt.cc +++ b/storage/xtradb/fil/fil0crypt.cc @@ -1,6 +1,6 @@ /***************************************************************************** Copyright (C) 2013, 2015, Google Inc. All Rights Reserved. -Copyright (C) 2014, 2015, MariaDB Corporation. All Rights Reserved. +Copyright (C) 2014, 2016, MariaDB Corporation. All Rights Reserved. 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 @@ -2522,6 +2522,7 @@ fil_space_crypt_get_status( mutex_enter(&crypt_data->mutex); status->keyserver_requests = crypt_data->keyserver_requests; status->min_key_version = crypt_data->min_key_version; + status->key_id = crypt_data->key_id; if (crypt_data->rotate_state.active_threads > 0 || crypt_data->rotate_state.flushing) { diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index f459f41fbc7..e11982de694 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -1,11 +1,10 @@ /***************************************************************************** Copyright (c) 2000, 2015, Oracle and/or its affiliates. -Copyright (c) 2013, 2015, MariaDB Corporation. +Copyright (c) 2013, 2016, MariaDB Corporation. Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2009, Percona Inc. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2013, 2014 SkySQL Ab. All Rights Reserved. Portions of this file contain modifications contributed and copyrighted by Google, Inc. Those modifications are gratefully acknowledged and are described @@ -8317,7 +8316,7 @@ ha_innobase::write_row( if (share->ib_table != prebuilt->table) { fprintf(stderr, - "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.", + "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.", share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt); } @@ -8670,7 +8669,7 @@ func_exit: if (share->ib_table != prebuilt->table) { fprintf(stderr, - "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.", + "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.", share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt); } @@ -9090,7 +9089,7 @@ ha_innobase::update_row( if (share->ib_table != prebuilt->table) { fprintf(stderr, - "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.", + "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.", share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt); } @@ -9211,7 +9210,7 @@ wsrep_error: if (share->ib_table != prebuilt->table) { fprintf(stderr, - "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.", + "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.", share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt); } @@ -12739,7 +12738,7 @@ ha_innobase::truncate() if (share->ib_table != prebuilt->table) { fprintf(stderr, - "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.", + "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.", share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt); } @@ -12760,7 +12759,7 @@ ha_innobase::truncate() if (share->ib_table != prebuilt->table) { fprintf(stderr, - "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.", + "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.", share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt); } @@ -14156,7 +14155,7 @@ ha_innobase::analyze( if (share->ib_table != prebuilt->table) { fprintf(stderr, - "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.", + "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.", share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt); } @@ -14172,7 +14171,7 @@ ha_innobase::analyze( if (share->ib_table != prebuilt->table) { fprintf(stderr, - "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.", + "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.", share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt); } @@ -15387,7 +15386,7 @@ ha_innobase::transactional_table_lock( if (share->ib_table != prebuilt->table) { fprintf(stderr, - "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.", + "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.", share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt); } diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc index e124cb98f99..09e72114711 100644 --- a/storage/xtradb/handler/i_s.cc +++ b/storage/xtradb/handler/i_s.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved. -Copyrigth (c) 2014, 2015, MariaDB Corporation +Copyrigth (c) 2014, 2016, MariaDB Corporation 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 @@ -8468,6 +8468,15 @@ static ST_FIELD_INFO innodb_tablespaces_encryption_fields_info[] = STRUCT_FLD(old_name, ""), STRUCT_FLD(open_method, SKIP_OPEN_TABLE)}, +#define TABLESPACES_ENCRYPTION_CURRENT_KEY_ID 8 + {STRUCT_FLD(field_name, "CURRENT_KEY_ID"), + STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS), + STRUCT_FLD(field_type, MYSQL_TYPE_LONG), + STRUCT_FLD(value, 0), + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED), + STRUCT_FLD(old_name, ""), + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)}, + END_OF_ST_FIELD_INFO }; @@ -8506,6 +8515,8 @@ i_s_dict_fill_tablespaces_encryption( status.min_key_version)); OK(fields[TABLESPACES_ENCRYPTION_CURRENT_KEY_VERSION]->store( status.current_key_version)); + OK(fields[TABLESPACES_ENCRYPTION_CURRENT_KEY_ID]->store( + status.key_id)); if (status.rotating) { fields[TABLESPACES_ENCRYPTION_KEY_ROTATION_PAGE_NUMBER]->set_notnull(); OK(fields[TABLESPACES_ENCRYPTION_KEY_ROTATION_PAGE_NUMBER]->store( diff --git a/storage/xtradb/include/fil0crypt.h b/storage/xtradb/include/fil0crypt.h index 32462661cd6..5deed1f001c 100644 --- a/storage/xtradb/include/fil0crypt.h +++ b/storage/xtradb/include/fil0crypt.h @@ -333,6 +333,7 @@ struct fil_space_crypt_status_t { uint min_key_version; /*!< min key version */ uint current_key_version;/*!< current key version */ uint keyserver_requests;/*!< no of key requests to key server */ + ulint key_id; /*!< current key_id */ bool rotating; /*!< is key rotation ongoing */ bool flushing; /*!< is flush at end of rotation ongoing */ ulint rotate_next_page_number; /*!< next page if key rotating */ |