diff options
Diffstat (limited to 'rulemgt/src/main/java/org/openo/holmes/rulemgt/db')
-rw-r--r-- | rulemgt/src/main/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDao.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDao.java b/rulemgt/src/main/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDao.java index d77cc09..487684e 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDao.java +++ b/rulemgt/src/main/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDao.java @@ -118,7 +118,10 @@ public class CorrelationRuleQueryDao { }
}
whereSql = whereSql.trim();
- return whereSql.substring(0, whereSql.length() - "AND".length());
+ if(!"WHERE".equals(whereSql)){
+ return whereSql.substring(0, whereSql.length() - "AND".length());
+ }
+ return "";
} catch (Exception e) {
throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_CREATE_QUERY_SQL_FAILED, e);
}
|