Skip to content

Commit

Permalink
0005197: fix upgrade with is_missing_pk and not_before
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Jun 24, 2022
1 parent 27dbcd1 commit 99f0494
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -451,7 +451,11 @@ public List<TriggerHistory> getActiveTriggerHistoriesFromCache() {
* Get a list of trigger histories that are currently active
*/
public List<TriggerHistory> getActiveTriggerHistories() {
List<TriggerHistory> histories = sqlTemplate.query(getSql("allTriggerHistSql", "activeTriggerHistSql"),
String sqlKey = "allTriggerHistSql";
if (!parameterService.hasDatabaseBeenSetup()) {
sqlKey = "allTriggerHistBackwardsCompatibleSql";
}
List<TriggerHistory> histories = sqlTemplate.query(getSql(sqlKey, "activeTriggerHistSql"),
new TriggerHistoryMapper());
for (TriggerHistory triggerHistory : histories) {
historyMap.put(triggerHistory.getTriggerHistoryId(), triggerHistory);
Expand Down Expand Up @@ -1411,7 +1415,10 @@ public boolean syncTriggers(StringBuilder sqlBuffer, boolean force) {
boolean createTriggersForTables = false;
String nodeId = nodeService.findIdentityNodeId();
if (StringUtils.isNotBlank(nodeId)) {
NodeSecurity nodeSecurity = nodeService.findNodeSecurity(nodeId);
NodeSecurity nodeSecurity = null;
if (!force) {
nodeSecurity = nodeService.findNodeSecurity(nodeId);
}
if (nodeSecurity != null && (nodeSecurity.isInitialLoadEnabled() || nodeSecurity.getInitialLoadEndTime() == null)) {
createTriggersForTables = parameterService.is(ParameterConstants.TRIGGER_CREATE_BEFORE_INITIAL_LOAD);
if (!createTriggersForTables) {
Expand Down

0 comments on commit 99f0494

Please sign in to comment.