Skip to content

Commit 8fe2f43

Browse files
committed
Extend YSQL error handling to include subquery-related and additional specific error cases across multiple generators
1 parent 8522446 commit 8fe2f43

7 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/sqlancer/yugabyte/ysql/YSQLErrors.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public static void addKnownIssues(ExpectedErrors errors) {
2020
errors.add("marked for deletion");
2121
errors.add("hit the limit");
2222
errors.add("insufficient disk space");
23+
errors.add("NullTest indexqual has wrong key");
2324
}
2425

2526
public static void addCommonFetchErrors(ExpectedErrors errors) {

src/sqlancer/yugabyte/ysql/gen/YSQLDeleteGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static SQLQueryAdapter create(YSQLGlobalState globalState) {
3838
}
3939
YSQLErrors.addCommonExpressionErrors(errors);
4040
YSQLErrors.addTransactionErrors(errors);
41+
YSQLErrors.addSubqueryErrors(errors);
4142
errors.add("out of range");
4243
errors.add("cannot cast");
4344
errors.add("invalid input syntax for");

src/sqlancer/yugabyte/ysql/gen/YSQLIndexGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ public static SQLQueryAdapter generate(YSQLGlobalState globalState) {
143143
errors.add("cannot use subquery in index expression");
144144
YSQLErrors.addCommonExpressionErrors(errors);
145145
YSQLErrors.addTransactionErrors(errors);
146+
YSQLErrors.addSubqueryErrors(errors);
146147
return new SQLQueryAdapter(sb.toString(), errors);
147148
}
148149

src/sqlancer/yugabyte/ysql/gen/YSQLMergeGenerator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ public static SQLQueryAdapter create(YSQLTable targetTable, YSQLGlobalState glob
201201

202202
YSQLErrors.addCommonExpressionErrors(errors);
203203
YSQLErrors.addCommonInsertUpdateErrors(errors);
204+
YSQLErrors.addTransactionErrors(errors);
205+
YSQLErrors.addSubqueryErrors(errors);
204206

205207
return new SQLQueryAdapter(sb.toString(), errors);
206208
}

src/sqlancer/yugabyte/ysql/gen/YSQLTableGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public YSQLTableGenerator(String tableName, boolean generateOnlyKnown, YSQLGloba
6767
YSQLErrors.addCommonExpressionErrors(errors);
6868
YSQLErrors.addCommonTableErrors(errors);
6969
YSQLErrors.addTransactionErrors(errors);
70+
YSQLErrors.addSubqueryErrors(errors);
7071
}
7172

7273
public static SQLQueryAdapter generate(String tableName, boolean generateOnlyKnown, YSQLGlobalState globalState) {

src/sqlancer/yugabyte/ysql/gen/YSQLUpdateGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ private SQLQueryAdapter generate() {
5252
errors.add("but expression is of type");
5353
YSQLErrors.addCommonExpressionErrors(errors);
5454
YSQLErrors.addTransactionErrors(errors);
55+
YSQLErrors.addSubqueryErrors(errors);
5556
if (!Randomly.getBooleanWithSmallProbability()) {
5657
sb.append(" WHERE ");
5758
YSQLExpression where = YSQLExpressionGenerator.generateExpression(globalState, randomTable.getColumns(),

src/sqlancer/yugabyte/ysql/gen/YSQLViewGenerator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ public static SQLQueryAdapter create(YSQLGlobalState globalState) {
5656
YSQLErrors.addViewErrors(errors);
5757
YSQLErrors.addCommonExpressionErrors(errors);
5858
YSQLErrors.addTransactionErrors(errors);
59+
YSQLErrors.addWindowFunctionErrors(errors);
60+
YSQLErrors.addCTEErrors(errors);
61+
YSQLErrors.addSetOperationErrors(errors);
62+
YSQLErrors.addSubqueryErrors(errors);
5963
return new SQLQueryAdapter(sb.toString(), errors, true);
6064
}
6165

0 commit comments

Comments
 (0)