Skip to content

Commit

Permalink
0003045: Sometimes insert on replicated tables fails on MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwellpettit committed Apr 17, 2017
1 parent 976dda9 commit 4f780ed
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ public String beforeUpgrade(ISymmetricDialect symmetricDialect, String tablePref
}
}
}

if (engine.getDatabasePlatform().getName().equals(DatabaseNamesConstants.MYSQL)) {
String function = tablePrefix + "_transaction_id_post_5_7_6";
String select = "select count(*) from information_schema.routines where routine_name='"
+ function + "' and routine_schema in (select database())";

if (engine.getDatabasePlatform().getSqlTemplate().queryForInt(select) > 0) {
String drop = "drop function " + function;
engine.getDatabasePlatform().getSqlTemplate().update(drop);
log.info("Just uninstalled {}", function);
}
}
return sb.toString();
}

Expand Down

0 comments on commit 4f780ed

Please sign in to comment.