forked from sqlancer/sqlancer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSQLite3Errors.java
More file actions
97 lines (80 loc) · 4.13 KB
/
SQLite3Errors.java
File metadata and controls
97 lines (80 loc) · 4.13 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package sqlancer.sqlite3;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Set;
public final class SQLite3Errors {
private SQLite3Errors() {
}
public static void addDeleteErrors(List<String> errors) {
// DELETE trigger for a view/table to which colomns were added or deleted
errors.add("columns but");
// trigger with on conflict clause
errors.add("ON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint");
}
public static void addExpectedExpressionErrors(Collection<String> errors) {
errors.add("FTS expression tree is too large");
errors.add("String or BLOB exceeds size limit");
errors.add("[SQLITE_ERROR] SQL error or missing database (integer overflow)");
errors.add("second argument to likelihood() must be a constant between 0.0 and 1.0");
errors.add("ORDER BY term out of range");
errors.add("GROUP BY term out of range");
errors.add("not authorized"); // load_extension
errors.add("aggregate functions are not allowed in the GROUP BY clause");
errors.add("parser stack overflow");
// nested query
errors.add("misuse of aggregate");
errors.add("second argument to nth_value must be a positive integer");
errors.add("parser stack overflow");
// window functions
errors.add("RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression");
errors.add("frame starting offset must be a non-negative integer");
errors.add("frame starting offset must be a non-negative number");
errors.add("unsupported frame specification");
errors.add("frame ending offset must be a non-negative integer");
errors.add("frame ending offset must be a non-negative number");
errors.add("argument of ntile must be a positive integer");
errors.add("malformed JSON");
errors.add("JSON cannot hold BLOB values");
errors.add("JSON path error");
errors.add("json_insert() needs an odd number of arguments");
errors.add("json_object() labels must be TEXT");
errors.add("json_object() requires an even number of arguments");
// fts5 functions
errors.add("unable to use function highlight in the requested context");
errors.add("no such cursor");
// INDEXED BY
errors.add("no query solution");
errors.add("no such index");
// UNION/INTERSECT ...
errors.add("ORDER BY term does not match any column in the result set");
errors.add("ORDER BY clause should come after");
errors.add("LIMIT clause should come after");
}
public static void addMatchQueryErrors(Collection<String> errors) {
errors.add("unable to use function MATCH in the requested context");
errors.add("malformed MATCH expression");
errors.add("fts5: syntax error near");
errors.add("no such column"); // vt0.c0 MATCH '-799256540'
errors.add("unknown special query"); // vt0.c1 MATCH '*YD)LC3^cG|'
errors.add("fts5: column queries are not supported"); // vt0.c0 MATCH '2016456922'
errors.add("fts5: phrase queries are not supported");
errors.add("unterminated string");
}
public static void addTableManipulationErrors(List<String> errors) {
errors.add("unsupported frame specification");
errors.add("non-deterministic functions prohibited in CHECK constraints");
errors.addAll(Arrays.asList("subqueries prohibited in CHECK constraints",
"generated columns cannot be part of the PRIMARY KEY", "must have at least one non-generated column"));
}
public static void addQueryErrors(Set<String> errors) {
errors.add("ON clause references tables to its right");
}
public static void addInsertNowErrors(List<String> errors) {
errors.add("non-deterministic use of strftime()");
errors.add("non-deterministic use of time()");
errors.add("non-deterministic use of datetime()");
errors.add("non-deterministic use of julianday()");
errors.add("non-deterministic use of date()");
}
}