forked from sqlancer/sqlancer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTiDBUnaryPrefixOperation.java
More file actions
43 lines (33 loc) · 1.09 KB
/
TiDBUnaryPrefixOperation.java
File metadata and controls
43 lines (33 loc) · 1.09 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
package sqlancer.tidb.ast;
import sqlancer.Randomly;
import sqlancer.common.ast.BinaryOperatorNode.Operator;
import sqlancer.common.ast.UnaryOperatorNode;
import sqlancer.tidb.ast.TiDBUnaryPrefixOperation.TiDBUnaryPrefixOperator;
public class TiDBUnaryPrefixOperation extends UnaryOperatorNode<TiDBExpression, TiDBUnaryPrefixOperator>
implements TiDBExpression {
public enum TiDBUnaryPrefixOperator implements Operator {
NOT("NOT"), //
INVERSION("~"), //
PLUS("+"), //
MINUS("-"), //
BINARY("BINARY"); //
private String s;
TiDBUnaryPrefixOperator(String s) {
this.s = s;
}
public static TiDBUnaryPrefixOperator getRandom() {
return Randomly.fromOptions(values());
}
@Override
public String getTextRepresentation() {
return s;
}
}
public TiDBUnaryPrefixOperation(TiDBExpression expr, TiDBUnaryPrefixOperator op) {
super(expr, op);
}
@Override
public OperatorKind getOperatorKind() {
return OperatorKind.PREFIX;
}
}