Skip to content

Commit 53d57e9

Browse files
committed
[DuckDB] Add options for the max number of views, deletes, and updates
1 parent 669540e commit 53d57e9

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

src/sqlancer/duckdb/DuckDBOptions.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ public class DuckDBOptions {
5757
@Parameter(names = "--test-indexes", description="Allow explicit (i.e. CREATE INDEX) and implicit (i.e., UNIQUE and PRIMARY KEY) indexes")
5858
public boolean testIndexes = true;
5959

60+
@Parameter(names = "--max-num-views", description="The maximum number of views that can be generated for a database")
61+
public int maxNumViews = 1;
62+
63+
@Parameter(names = "--max-num-deletes", description="The maximum number of DELETE statements that are issued for a database")
64+
public int maxNumDeletes = 1;
65+
66+
@Parameter(names = "--max-num-updates", description="The maximum number of UPDATE statements that are issued for a database")
67+
public int maxNumUpdates = 5;
68+
6069
@Parameter(names = "--oracle", converter = DBMSConverter.class)
6170
public List<DuckDBOracle> oracle = Arrays.asList(DuckDBOracle.QUERY_PARTITIONING);
6271

src/sqlancer/duckdb/DuckDBProvider.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,15 @@ private static int mapActions(DuckDBGlobalState globalState, Action a) {
7070
}
7171
// fall through
7272
case UPDATE:
73-
return r.getInteger(0, 4);
73+
return r.getInteger(0, globalState.getDmbsSpecificOptions().maxNumUpdates + 1);
7474
case VACUUM: // seems to be ignored
7575
case ANALYZE: // seems to be ignored
76-
case DELETE:
7776
case EXPLAIN:
78-
case CREATE_VIEW:
7977
return r.getInteger(0, 2);
78+
case DELETE:
79+
return r.getInteger(0, globalState.getDmbsSpecificOptions().maxNumDeletes + 1);
80+
case CREATE_VIEW:
81+
return r.getInteger(0, globalState.getDmbsSpecificOptions().maxNumViews + 1);
8082
default:
8183
throw new AssertionError(a);
8284
}

0 commit comments

Comments
 (0)