Skip to content

Commit

Permalink
0000949: reload table doesn't work with wildcard triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Jun 23, 2013
1 parent 427aa1c commit d999c45
Showing 1 changed file with 10 additions and 4 deletions.
Expand Up @@ -61,6 +61,7 @@
import org.jumpmind.symmetric.service.INodeService;
import org.jumpmind.symmetric.service.ITriggerRouterService;
import org.jumpmind.symmetric.statistic.IStatisticManager;
import org.jumpmind.util.FormatUtils;

/**
* @see ITriggerRouterService
Expand Down Expand Up @@ -236,19 +237,24 @@ public TriggerHistory findTriggerHistory(String catalogName, String schemaName,
public List<TriggerHistory> findTriggerHistories(String catalogName, String schemaName,
String tableName) {
List<TriggerHistory> listToReturn = new ArrayList<TriggerHistory>();
List<TriggerHistory> triggerHistories = sqlTemplate
.query(getSql("allTriggerHistSql", "triggerHistBySourceTableWhereSql"),
new TriggerHistoryMapper(), new Object[] { tableName },
new int[] { Types.VARCHAR });
List<TriggerHistory> triggerHistories = getActiveTriggerHistories();
if (triggerHistories != null && triggerHistories.size() > 0) {
for (TriggerHistory triggerHistory : triggerHistories) {
boolean matches = true;
if (StringUtils.isNotBlank(catalogName)) {
matches = catalogName.equals(triggerHistory.getSourceCatalogName());
}

if (matches && StringUtils.isNotBlank(schemaName)) {
matches = schemaName.equals(triggerHistory.getSourceSchemaName());
}

if (matches && StringUtils.isNotBlank(tableName)) {
boolean ignoreCase = parameterService.is(ParameterConstants.DB_METADATA_IGNORE_CASE) &&
!FormatUtils.isMixedCase(tableName);
matches = ignoreCase ? triggerHistory.getSourceTableName().equalsIgnoreCase(tableName) :
triggerHistory.getSourceTableName().equals(tableName);
}

if (matches) {
listToReturn.add(triggerHistory);
Expand Down

0 comments on commit d999c45

Please sign in to comment.