Skip to content

Commit

Permalink
0003478: Sync triggers in MySQL will fail if there is an active trigger
Browse files Browse the repository at this point in the history
history record but the table was removed manually
  • Loading branch information
jumpmind-josh committed Mar 7, 2018
1 parent dddf5fd commit 0e834c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -163,7 +163,7 @@ protected boolean doesTriggerExistOnPlatform(String catalog, String schema, Stri
public void removeTrigger(StringBuilder sqlBuffer, String catalogName, String schemaName,
String triggerName, String tableName, ISqlTransaction transaction) {
catalogName = catalogName == null ? "" : (catalogName + ".");
final String sql = "drop trigger " + catalogName + triggerName;
final String sql = "drop trigger if exists " + catalogName + triggerName;
logSql(sql, sqlBuffer);
if (parameterService.is(ParameterConstants.AUTO_SYNC_TRIGGERS)) {
transaction.execute(sql);
Expand Down
Expand Up @@ -1374,7 +1374,7 @@ protected void dropTriggers(TriggerHistory history, StringBuilder sqlBuffer) {
} else {
inactivateTriggerHistory(history);
}
} catch (Error ex) {
} catch (Throwable ex) {
log.error("Error while dropping triggers for table %s", history.getSourceTableName(), ex);
}
}
Expand Down

0 comments on commit 0e834c9

Please sign in to comment.