Commit 93a7b4d7 authored by Erdem Karakus's avatar Erdem Karakus

REPO-2179 Skip Duplicate key name error on MySQL index creation

In MySQL, Duplicate key error is skipped while creating index on lock
table, because the error means that the index is already created on
the lock table and it's not necessary to either throw an exception or
take any action.
parent 8aa20358
......@@ -103,6 +103,10 @@ public class MySqlDbLockManager extends DbLockManager {
if (lowerCaseMsg.contains("duplicate entry") || lowerCaseMsg.contains("data truncated")) {
log.info("After truncate but before table alteration entries have been inserted");
correctTableScheme(tableName, connection, retries - 1);
} else if (lowerCaseMsg.contains("duplicate key name")) {
// Duplicate key exception means that the unique index is already created
// In this case it's not necessary to either execute the batch query again or throw an exception
return;
} else {
throw e;
}
......
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