dcapwell commented on code in PR #4674:
URL: https://github.com/apache/cassandra/pull/4674#discussion_r3599378893
##########
test/harry/main/org/apache/cassandra/harry/model/ASTSingleTableModel.java:
##########
@@ -2572,6 +2446,46 @@ private TokenCondition(Inequality inequality, Token
token)
}
}
+ private static class LikeCondition
+ {
+ private final ByteBuffer pattern;
+
+ private LikeCondition(ByteBuffer pattern)
+ {
+ this.pattern = pattern;
+ }
+
+ private boolean matches(AbstractType<?> type, ByteBuffer value)
+ {
+ String valueStr = type.getString(value);
+ String patternStr = type.getString(pattern);
+
+ if (patternStr.startsWith("%") && patternStr.endsWith("%"))
+ {
+ // Contains
+ String substring = patternStr.substring(1, patternStr.length()
- 1);
Review Comment:
```
jshell> String patternStr = "%"
patternStr ==> "%"
jshell> String substring = patternStr.substring(1, patternStr.length() - 1);
| Exception java.lang.StringIndexOutOfBoundsException: begin 1, end 0,
length 1
| at String.checkBoundsBeginEnd (String.java:3319)
| at String.substring (String.java:1874)
| at (#2:1)
jshell>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]