-
Notifications
You must be signed in to change notification settings - Fork 397
Expand file tree
/
Copy pathMariaDBBinaryOperator.java
More file actions
56 lines (40 loc) · 1.43 KB
/
MariaDBBinaryOperator.java
File metadata and controls
56 lines (40 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package sqlancer.mariadb.ast;
import sqlancer.Randomly;
public class MariaDBBinaryOperator implements MariaDBExpression {
private MariaDBExpression left;
private MariaDBExpression right;
private MariaDBBinaryComparisonOperator op;
public enum MariaDBBinaryComparisonOperator {
NOT_EQUAL("!="), LESS_THAN("<"), /* NULL_SAFE_EQUAL("<=>"), EQUALS("="), */ GREATER_THAN(">"),
GREATER_THAN_EQUAL(">="),
// regex
LIKE("LIKE"), RLIKE("RLIKE"), REGEXP("REGEXP"),
// PLUS("+");
AND("AND"), OR("OR"), XOR("XOR"),
BITWISE_AND("&"), LEFT_SHIFT("<<"), RIGHT_SHIFT(">>"), BITWISE_XOR("^"), BITWISE_OR("|");
private String op;
MariaDBBinaryComparisonOperator(String op) {
this.op = op;
}
public String getTextRepresentation() {
return op;
}
public static MariaDBBinaryComparisonOperator getRandom() {
return Randomly.fromOptions(MariaDBBinaryComparisonOperator.values());
}
};
public MariaDBBinaryOperator(MariaDBExpression left, MariaDBExpression right, MariaDBBinaryComparisonOperator op) {
this.left = left;
this.right = right;
this.op = op;
}
public MariaDBExpression getLeft() {
return left;
}
public MariaDBExpression getRight() {
return right;
};
public MariaDBBinaryComparisonOperator getOp() {
return op;
}
}