sqlancer.cockroachdb.ast.CockroachDBMultiValuedComparison Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sqlancer Show documentation
Show all versions of sqlancer Show documentation
SQLancer finds logic bugs in Database Management Systems through automatic testing
package sqlancer.cockroachdb.ast;
import java.util.List;
import sqlancer.Randomly;
public class CockroachDBMultiValuedComparison implements CockroachDBExpression {
private CockroachDBExpression left;
private List right;
private MultiValuedComparisonType type;
private MultiValuedComparisonOperator op;
public enum MultiValuedComparisonType {
ANY, SOME, ALL;
public static MultiValuedComparisonType getRandom() {
return Randomly.fromOptions(values());
}
}
public enum MultiValuedComparisonOperator {
SMALLER("<"), GREATER(">"), EQUALS("="), SMALLER_EQUALS("<="), GREATER_EQUALS(">="), NOT_EQUALS("!=");
private String stringRepr;
MultiValuedComparisonOperator(String stringRepr) {
this.stringRepr = stringRepr;
}
public String getStringRepr() {
return stringRepr;
}
public static MultiValuedComparisonOperator getRandomGenericComparisonOperator() {
return Randomly.fromOptions(SMALLER, GREATER);
}
}
public CockroachDBMultiValuedComparison(CockroachDBExpression left, List right,
MultiValuedComparisonType type, MultiValuedComparisonOperator op) {
this.left = left;
this.right = right;
this.type = type;
this.op = op;
}
public CockroachDBExpression getLeft() {
return left;
}
public MultiValuedComparisonOperator getOp() {
return op;
}
public List getRight() {
return right;
}
public MultiValuedComparisonType getType() {
return type;
}
}