Commit 62333712 authored by Erdem Karakus's avatar Erdem Karakus

REPO-2179 [Backport 11.2] 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.

(cherry picked from commit 93a7b4d7)
parent 555c05c4
......@@ -103,6 +103,10 @@ public class MySqlDbLockManager extends DbLockManager {
if (lowerCaseMsg.contains("duplicate entry") || lowerCaseMsg.contains("data truncated")) {"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
} 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