Skip to content

Commit d1786ae

Browse files
committed
[SQLite3] Add an option for testing joins
1 parent aebe4f4 commit d1786ae

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/sqlancer/sqlite3/SQLite3Options.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public class SQLite3Options {
5050
@Parameter(names = { "--test-nulls-first-last" }, description = "Allow NULLS FIRST/NULLS LAST in ordering terms", arity = 1)
5151
public boolean testNullsFirstLast;
5252

53+
@Parameter(names = { "--test-joins" }, description = "Allow the generation of JOIN clauses", arity = 1)
54+
public boolean testJoins;
55+
5356

5457
@Parameter(names = "--oracle", converter = DBMSConverter.class)
5558
public SQLite3Oracle oracle = SQLite3Oracle.METAMORPHIC;

src/sqlancer/sqlite3/gen/SQLite3ExpressionGenerator.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ public List<SQLite3Expression> generateOrderBys() {
118118

119119
public List<Join> getRandomJoinClauses(List<SQLite3Table> tables) {
120120
List<Join> joinStatements = new ArrayList<>();
121+
if (!globalState.getDmbsSpecificOptions().testJoins) {
122+
return joinStatements;
123+
}
121124
if (Randomly.getBoolean() && tables.size() > 1) {
122125
int nrJoinClauses = (int) Randomly.getNotCachedInteger(0, tables.size());
123126
for (int i = 0; i < nrJoinClauses; i++) {

0 commit comments

Comments
 (0)