Skip to content

Commit e7e121f

Browse files
committed
Extend YSQL error handling with additional specific error cases across multiple generators.
1 parent 3333563 commit e7e121f

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public static SQLQueryAdapter generate(YSQLGlobalState globalState) {
2424
YSQLErrors.addCommonExpressionErrors(errors);
2525
errors.add("does not exist");
2626
errors.add("already in use");
27+
errors.add("already exists");
2728
errors.add("is not open");
2829
errors.add("no such cursor");
2930
errors.add("cursor can only scan forward");

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public static SQLQueryAdapter insert(YSQLGlobalState globalState) {
5050
errors.add("invalid input syntax");
5151
errors.add("division by zero");
5252
errors.add("data type unknown");
53+
errors.add("INSERT with ON CONFLICT clause cannot be used with table that has INSERT or UPDATE rules");
5354
StringBuilder sb = new StringBuilder();
5455
sb.append("INSERT INTO ");
5556
sb.append(table.getName());

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public static SQLQueryAdapter generate(YSQLGlobalState globalState) {
2929
errors.add("row-level security");
3030
errors.add("row level security");
3131
errors.add("new row violates row-level security");
32+
errors.add("only WITH CHECK expression allowed for INSERT");
3233
errors.add("This statement not supported yet");
3334

3435
switch (Randomly.fromOptions(0, 1, 2, 3)) {

0 commit comments

Comments
 (0)