forked from sqlancer/sqlancer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCitusAlterTableGenerator.java
More file actions
50 lines (43 loc) · 1.95 KB
/
CitusAlterTableGenerator.java
File metadata and controls
50 lines (43 loc) · 1.95 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
package sqlancer.citus.gen;
import java.util.List;
import sqlancer.IgnoreMeException;
import sqlancer.common.query.ExpectedErrors;
import sqlancer.common.query.SQLQueryAdapter;
import sqlancer.postgres.PostgresGlobalState;
import sqlancer.postgres.PostgresSchema.PostgresTable;
import sqlancer.postgres.gen.PostgresAlterTableGenerator;
public class CitusAlterTableGenerator extends PostgresAlterTableGenerator {
public CitusAlterTableGenerator(PostgresTable randomTable, PostgresGlobalState globalState,
boolean generateOnlyKnown) {
super(randomTable, globalState, generateOnlyKnown);
}
public static SQLQueryAdapter create(PostgresTable randomTable, PostgresGlobalState globalState,
boolean generateOnlyKnown) {
return new CitusAlterTableGenerator(randomTable, globalState, generateOnlyKnown).generate();
}
@Override
public List<Action> getActions(ExpectedErrors errors) {
List<Action> action = super.getActions(errors);
CitusCommon.addCitusErrors(errors);
action.remove(Action.ALTER_COLUMN_SET_STATISTICS);
action.remove(Action.ALTER_COLUMN_SET_ATTRIBUTE_OPTION);
action.remove(Action.ALTER_COLUMN_RESET_ATTRIBUTE_OPTION);
action.remove(Action.ALTER_COLUMN_SET_STORAGE);
action.remove(Action.DISABLE_ROW_LEVEL_SECURITY);
action.remove(Action.ENABLE_ROW_LEVEL_SECURITY);
action.remove(Action.FORCE_ROW_LEVEL_SECURITY);
action.remove(Action.NO_FORCE_ROW_LEVEL_SECURITY);
action.remove(Action.CLUSTER_ON);
action.remove(Action.SET_WITHOUT_CLUSTER);
action.remove(Action.SET_WITH_OIDS);
action.remove(Action.SET_WITHOUT_OIDS);
action.remove(Action.SET_LOGGED_UNLOGGED);
action.remove(Action.NOT_OF);
action.remove(Action.OWNER_TO);
action.remove(Action.REPLICA_IDENTITY);
if (action.isEmpty()) {
throw new IgnoreMeException();
}
return action;
}
}