Skip to content

Commit

Permalink
0005329: Sync triggers empty trigger hist pk column names
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Jun 6, 2022
1 parent a665d76 commit b53393b
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -1725,11 +1725,9 @@ public boolean syncTriggers(List<Table> tables, boolean force) {
List<Trigger> triggersForCurrentNode = getTriggersForCurrentNode();
List<TriggerHistory> activeTriggerHistories = getActiveTriggerHistories();
Map<String, List<TriggerTableSupportingInfo>> triggerToTableSupportingInfo = getTriggerToTableSupportingInfo(triggersForCurrentNode,
activeTriggerHistories, true);
activeTriggerHistories, false);
for (Table table : tables) {
/* Re-lookup just in case the table was just altered */
IDatabasePlatform targetPlatform = symmetricDialect.getTargetPlatform(table.getName());
table = targetPlatform.getTableFromCache(table.getCatalog(), table.getSchema(), table.getName(), true);
for (Trigger trigger : triggersForCurrentNode) {
if (trigger.matches(table, targetPlatform.getDefaultCatalog(), targetPlatform.getDefaultSchema(), ignoreCase) &&
(!trigger.isSourceTableNameWildCarded() || !trigger.isSourceTableNameExpanded()
Expand All @@ -1744,7 +1742,8 @@ public boolean syncTriggers(List<Table> tables, boolean force) {
}
if (triggerTableSupportingInfo != null) {
log.info("Synchronizing triggers for {}", table.getFullyQualifiedTableName());
updateOrCreateDatabaseTriggers(trigger, table, null, force, true, activeTriggerHistories, triggerTableSupportingInfo);
updateOrCreateDatabaseTriggers(trigger, triggerTableSupportingInfo.getTable(), null, force, true, activeTriggerHistories,
triggerTableSupportingInfo);
log.info("Done synchronizing triggers for {}", table.getFullyQualifiedTableName());
} else {
log.warn("Can't find table {} for trigger {}, make sure table exists.", table.getFullyQualifiedTableName(), trigger.getTriggerId());
Expand Down

0 comments on commit b53393b

Please sign in to comment.