-
Notifications
You must be signed in to change notification settings - Fork 397
Expand file tree
/
Copy pathMariaDBErrors.java
More file actions
69 lines (58 loc) · 2.49 KB
/
MariaDBErrors.java
File metadata and controls
69 lines (58 loc) · 2.49 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
package sqlancer.mariadb;
import java.util.ArrayList;
import java.util.List;
import sqlancer.common.query.ExpectedErrors;
public final class MariaDBErrors {
private MariaDBErrors() {
}
public static List<String> getCommonErrors() {
ArrayList<String> errors = new ArrayList<>();
errors.add("is out of range");
// regex
errors.add("unmatched parentheses");
errors.add("nothing to repeat at offset");
errors.add("missing )");
errors.add("missing terminating ]");
errors.add("range out of order in character class");
errors.add("unrecognized character after ");
errors.add("Got error '(*VERB) not recognized or malformed");
errors.add("must be followed by");
errors.add("malformed number or name after");
errors.add("digit expected after");
errors.add("Regex error");
errors.add("Lock wait timeout exceeded");
return errors;
}
public static void addCommonErrors(ExpectedErrors errors) {
errors.add("is out of range");
// regex
errors.add("unmatched parentheses");
errors.add("nothing to repeat at offset");
errors.add("missing )");
errors.add("missing terminating ]");
errors.add("range out of order in character class");
errors.add("unrecognized character after ");
errors.add("Got error '(*VERB) not recognized or malformed");
errors.add("must be followed by");
errors.add("malformed number or name after");
errors.add("digit expected after");
errors.add("Regex error");
errors.add("Lock wait timeout exceeded");
}
public static List<String> getInsertErrors() {
ArrayList<String> errors = new ArrayList<>();
errors.add("Out of range");
errors.add("Duplicate entry"); // violates UNIQUE constraint
errors.add("cannot be null"); // violates NOT NULL constraint
errors.add("Incorrect integer value"); // e.g., insert TEXT into an int value
errors.add("Data truncated for column"); // int + plus string into int
errors.add("doesn't have a default value"); // no default value
errors.add("The value specified for generated column"); // trying to insert into a generated column
errors.add("Incorrect double value");
errors.add("Incorrect string value");
return errors;
}
public static void addInsertErrors(ExpectedErrors errors) {
errors.addAll(getInsertErrors());
}
}