Skip to content

Commit

Permalink
Merge pull request #12646 from ashanhr/master
Browse files Browse the repository at this point in the history
Fix Oracle Database Issue in Block Condition Search
  • Loading branch information
RakhithaRR authored Oct 11, 2024
2 parents 60991fb + dab7e94 commit c877918
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14072,10 +14072,12 @@ public List<BlockConditionsDTO> getBlockConditionsByConditionTypeAndValue(String
String conditionTypeUpper = conditionType != null ? conditionType.toUpperCase() : null;
selectPreparedStatement.setString(1, conditionTypeUpper);
selectPreparedStatement.setString(2, conditionTypeUpper);
selectPreparedStatement.setString(3, conditionValue);
if (isExactMatch) {
selectPreparedStatement.setString(3, conditionValue);
selectPreparedStatement.setString(4, tenantDomain);
} else {
String conditionValuePattern = "%" + conditionValue + "%";
selectPreparedStatement.setString(3, conditionValuePattern);
selectPreparedStatement.setString(4, conditionValue);
selectPreparedStatement.setString(5, tenantDomain);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3393,7 +3393,7 @@ public static class ThrottleSQLConstants{
+ "BLOCK_CONDITION = ? AND DOMAIN = ? ";
public static final String GET_BLOCK_CONDITIONS_BY_TYPE_AND_VALUE_SQL =
"SELECT CONDITION_ID, TYPE, BLOCK_CONDITION, ENABLED, DOMAIN, UUID FROM AM_BLOCK_CONDITIONS WHERE "
+ "(TYPE = ? OR ? IS NULL) AND (BLOCK_CONDITION LIKE CONCAT('%', ?, '%') OR ? IS NULL) AND DOMAIN = ?";
+ "(TYPE = ? OR ? IS NULL) AND (BLOCK_CONDITION LIKE ? OR ? IS NULL) AND DOMAIN = ?";
public static final String GET_BLOCK_CONDITIONS_BY_TYPE_AND_EXACT_VALUE_SQL =
"SELECT CONDITION_ID, TYPE, BLOCK_CONDITION, ENABLED, DOMAIN, UUID FROM AM_BLOCK_CONDITIONS WHERE "
+ "(TYPE = ? OR ? IS NULL) AND (BLOCK_CONDITION = ?) AND DOMAIN = ?";
Expand Down

0 comments on commit c877918

Please sign in to comment.