forked from sqlancer/sqlancer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMySQLOptions.java
More file actions
76 lines (60 loc) · 2.36 KB
/
Copy pathMySQLOptions.java
File metadata and controls
76 lines (60 loc) · 2.36 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package sqlancer.mysql;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.List;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import sqlancer.DBMSSpecificOptions;
import sqlancer.OracleFactory;
import sqlancer.common.oracle.TestOracle;
import sqlancer.mysql.MySQLOptions.MySQLOracleFactory;
import sqlancer.mysql.oracle.MySQLCERTOracle;
import sqlancer.mysql.oracle.MySQLFuzzer;
import sqlancer.mysql.oracle.MySQLPivotedQuerySynthesisOracle;
import sqlancer.mysql.oracle.MySQLTLPWhereOracle;
@Parameters(separators = "=", commandDescription = "MySQL (default port: " + MySQLOptions.DEFAULT_PORT
+ ", default host: " + MySQLOptions.DEFAULT_HOST + ")")
public class MySQLOptions implements DBMSSpecificOptions<MySQLOracleFactory> {
public static final String DEFAULT_HOST = "localhost";
public static final int DEFAULT_PORT = 3306;
@Parameter(names = "--oracle")
public List<MySQLOracleFactory> oracles = Arrays.asList(MySQLOracleFactory.TLP_WHERE);
public enum MySQLOracleFactory implements OracleFactory<MySQLGlobalState> {
TLP_WHERE {
@Override
public TestOracle<MySQLGlobalState> create(MySQLGlobalState globalState) throws SQLException {
return new MySQLTLPWhereOracle(globalState);
}
},
PQS {
@Override
public TestOracle<MySQLGlobalState> create(MySQLGlobalState globalState) throws SQLException {
return new MySQLPivotedQuerySynthesisOracle(globalState);
}
@Override
public boolean requiresAllTablesToContainRows() {
return true;
}
},
CERT {
@Override
public TestOracle<MySQLGlobalState> create(MySQLGlobalState globalState) throws SQLException {
return new MySQLCERTOracle(globalState);
}
@Override
public boolean requiresAllTablesToContainRows() {
return true;
}
},
FUZZER {
@Override
public TestOracle<MySQLGlobalState> create(MySQLGlobalState globalState) throws Exception {
return new MySQLFuzzer(globalState);
}
};
}
@Override
public List<MySQLOracleFactory> getTestOracleFactory() {
return oracles;
}
}