forked from sqlancer/sqlancer
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathH2Errors.java
More file actions
71 lines (56 loc) · 2.32 KB
/
Copy pathH2Errors.java
File metadata and controls
71 lines (56 loc) · 2.32 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package sqlancer.h2;
import java.util.ArrayList;
import java.util.List;
import sqlancer.common.query.ExpectedErrors;
public final class H2Errors {
private H2Errors() {
}
public static List<String> getInsertErrors() {
ArrayList<String> errors = new ArrayList<>();
errors.add("NULL not allowed for column");
errors.add("Unique index or primary key violation");
errors.add("Data conversion error");
errors.add("Generated column");
errors.add("Value too long for column");
errors.add("Referential integrity constraint violation");
errors.add("Check constraint invalid");
errors.add("Check constraint violation");
return errors;
}
public static void addInsertErrors(ExpectedErrors errors) {
errors.addAll(getInsertErrors());
}
public static List<String> getExpressionErrors() {
ArrayList<String> errors = new ArrayList<>();
errors.add("java.lang.ArithmeticException: BigInteger would overflow supported range");
errors.add("Value too long for column");
errors.add("Numeric value out of range");
errors.add("are not comparable");
errors.add("Data conversion error converting");
errors.add("Feature not supported");
errors.add("must be in the GROUP BY list");
errors.add("must be in the result list in this case");
errors.add("Division by zero");
errors.add("Unclosed group near index");
errors.add("Error in LIKE ESCAPE");
errors.add("Invalid value");
errors.add("String format error");
errors.add("must be between");
errors.add("Cannot parse \"TIMESTAMP\" constant");
errors.add("Invalid parameter count for \"TRUNC\", expected count: \"1\"");
return errors;
}
public static void addExpressionErrors(ExpectedErrors errors) {
errors.addAll(getExpressionErrors());
}
public static List<String> getDeleteErrors() {
ArrayList<String> errors = new ArrayList<>();
errors.add("No default value is set for column");
errors.add("Referential integrity constraint violation");
errors.add("NULL not allowed for column");
return errors;
}
public static void addDeleteErrors(ExpectedErrors errors) {
errors.addAll(getDeleteErrors());
}
}