Skip to content

Commit f3d18ff

Browse files
Bug#32637784: MYSQL_MIGRATE_KEYRING DOES NOT ENFORCE DISTINCT SOURCE AND DESTINATION KEYSTORES
Description: Sanity checks for source and destination keyring didn't account for same keyring specified twice. Fix: Added checks to make sure that source and destination keyring are not the same. RB: 26138
1 parent e6ee90e commit f3d18ff

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

client/migrate_keyring/options.cc

+5
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ static bool check_options_for_sanity() {
222222
<< std::endl;
223223
return false;
224224
}
225+
226+
if (strcmp(Options::s_source_keyring, Options::s_destination_keyring) == 0) {
227+
log_error << "Source and destination cannot be the same." << std::endl;
228+
return false;
229+
}
225230
return true;
226231
}
227232

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# Bug #32637784: MYSQL_MIGRATE_KEYRING DOES NOT ENFORCE
3+
# DISTINCT SOURCE AND DESTINATION KEYSTORES
4+
#
5+
TIMESTAMP [ERROR] Source and destination cannot be the same.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
--echo #
2+
--echo # Bug #32637784: MYSQL_MIGRATE_KEYRING DOES NOT ENFORCE
3+
--echo # DISTINCT SOURCE AND DESTINATION KEYSTORES
4+
--echo #
5+
6+
--replace_regex /[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/TIMESTAMP/
7+
--exec $MYSQL_MIGRATE_KEYRING --component-dir=foo --source-keyring=bar --destination-keyring=bar 2>&1

0 commit comments

Comments
 (0)