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
56 lines (42 loc) · 1.67 KB
/
MySQLOptions.java
File metadata and controls
56 lines (42 loc) · 1.67 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.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.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 create(MySQLGlobalState globalState) throws SQLException {
return new MySQLTLPWhereOracle(globalState);
}
},
PQS {
@Override
public TestOracle create(MySQLGlobalState globalState) throws SQLException {
return new MySQLPivotedQuerySynthesisOracle(globalState);
}
@Override
public boolean requiresAllTablesToContainRows() {
return true;
}
}
}
@Override
public List<MySQLOracleFactory> getTestOracleFactory() {
return oracles;
}
}