Skip to content

Commit da86cdb

Browse files
author
Allen Lai
committed
Followup patch of TDE wls to fix valgrind failure and windows failure.
1 parent 1ca1896 commit da86cdb

File tree

6 files changed

+7
-4
lines changed

6 files changed

+7
-4
lines changed

mysql-test/suite/innodb/r/table_encrypt_1.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ call mtr.add_suppression("\\[ERROR\\] InnoDB: Failed to find tablespace for tabl
33
call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number 2 in a file operation.");
44
call mtr.add_suppression("\\[ERROR\\] InnoDB: The error means the system cannot find the path specified.");
55
call mtr.add_suppression("\\[ERROR\\] InnoDB: Could not find a valid tablespace file for");
6-
call mtr.add_suppression("\\[ERROR\\] InnoDB: Encryption information in datafile: .*\.ibd can't be decrypted , please confirm the keyfile is match and keyring plugin is loaded.");
6+
call mtr.add_suppression("ibd can't be decrypted , please confirm the keyfile is match and keyring plugin is loaded.");
77
call mtr.add_suppression("\\[Warning\\] InnoDB: Ignoring tablespace .* because it could not be opened");
88
call mtr.add_suppression("\\[ERROR\\] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.");
99
CREATE TABLE t1(c1 INT, c2 char(20)) ENCRYPTION="Y" ENGINE = InnoDB;

mysql-test/suite/innodb/t/table_encrypt_1.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ call mtr.add_suppression("\\[ERROR\\] InnoDB: Failed to find tablespace for tabl
1414
call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number 2 in a file operation.");
1515
call mtr.add_suppression("\\[ERROR\\] InnoDB: The error means the system cannot find the path specified.");
1616
call mtr.add_suppression("\\[ERROR\\] InnoDB: Could not find a valid tablespace file for");
17-
call mtr.add_suppression("\\[ERROR\\] InnoDB: Encryption information in datafile: .*\.ibd can't be decrypted , please confirm the keyfile is match and keyring plugin is loaded.");
17+
call mtr.add_suppression("ibd can't be decrypted , please confirm the keyfile is match and keyring plugin is loaded.");
1818
call mtr.add_suppression("\\[Warning\\] InnoDB: Ignoring tablespace .* because it could not be opened");
1919
call mtr.add_suppression("\\[ERROR\\] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.");
2020
--error ER_CANNOT_FIND_KEY_IN_KEYRING

plugin/keyring/keyring.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extern mysql_rwlock_t LOCK_keyring;
3535
extern unique_ptr<IKeys_container> keys;
3636
extern my_bool is_keys_container_initialized;
3737
extern unique_ptr<ILogger> logger;
38-
extern unique_ptr<char> keyring_file_data;
38+
extern unique_ptr<char[]> keyring_file_data;
3939

4040
#ifdef HAVE_PSI_INTERFACE
4141
void keyring_init_psi_keys(void);

plugin/keyring/keyring_impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ mysql_rwlock_t LOCK_keyring;
2727
unique_ptr<IKeys_container> keys;
2828
my_bool is_keys_container_initialized= FALSE;
2929
unique_ptr<ILogger> logger;
30-
unique_ptr<char> keyring_file_data;
30+
unique_ptr<char[]> keyring_file_data;
3131

3232
#ifdef HAVE_PSI_INTERFACE
3333
static PSI_rwlock_info all_keyring_rwlocks[]=

storage/innobase/fsp/fsp0fsp.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,7 @@ fsp_header_fill_encryption_info(
904904
return(false);
905905
}
906906

907+
memset(encrypt_info, 0, ENCRYPTION_INFO_SIZE);
907908
/* Use the new master key to encrypt the tablespace
908909
key. */
909910
ut_ad(encrypt_info != NULL);

storage/innobase/handler/ha_innodb.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10036,6 +10036,7 @@ create_table_info_t::create_table_def()
1003610036

1003710037
my_error(ER_TABLESPACE_CANNOT_ENCRYPT, MYF(0));
1003810038
err = DB_UNSUPPORTED;
10039+
dict_mem_table_free(table);
1003910040

1004010041
} else if (!Encryption::is_none(encrypt)) {
1004110042
/* Set the encryption flag. */
@@ -10050,6 +10051,7 @@ create_table_info_t::create_table_def()
1005010051
my_error(ER_CANNOT_FIND_KEY_IN_KEYRING,
1005110052
MYF(0));
1005210053
err = DB_UNSUPPORTED;
10054+
dict_mem_table_free(table);
1005310055
} else {
1005410056
my_free(master_key);
1005510057
DICT_TF2_FLAG_SET(table,

0 commit comments

Comments
 (0)