|
1 | 1 | package sqlancer.clickhouse; |
2 | 2 |
|
| 3 | +import java.util.List; |
| 4 | + |
3 | 5 | import sqlancer.common.query.ExpectedErrors; |
4 | 6 |
|
5 | 7 | public final class ClickHouseErrors { |
6 | 8 |
|
7 | 9 | private ClickHouseErrors() { |
8 | 10 | } |
9 | 11 |
|
10 | | - public static void addExpectedExpressionErrors(ExpectedErrors errors) { |
11 | | - errors.add("Argument at index 1 for function like must be constant"); |
12 | | - errors.add("Argument at index 1 for function notLike must be constant"); |
13 | | - errors.add("Attempt to read after eof: while converting"); |
14 | | - errors.add("Bad get: has Int64, requested UInt64"); |
15 | | - errors.add("Cannot convert string"); |
16 | | - errors.add("Cannot insert NULL value into a column of type"); |
17 | | - errors.add("Cannot parse Int32 from String, because value is too short"); |
18 | | - errors.add("Cannot parse NaN.: while converting"); // https://github.com/ClickHouse/ClickHouse/issues/22710 |
19 | | - errors.add("Cannot parse infinity."); |
20 | | - errors.add("Cannot parse number with a sign character but without any numeric character"); |
21 | | - errors.add("Cannot parse number with multiple sign (+/-) characters or intermediate sign character"); |
22 | | - errors.add("Cannot parse string"); |
23 | | - errors.add("Cannot read floating point value"); |
24 | | - errors.add("Cyclic aliases: default expression and column type are incompatible"); |
25 | | - errors.add("Directory for table data"); |
26 | | - errors.add("Directory not empty"); |
27 | | - errors.add("Expected one of: compound identifier, identifier, list of elements (version"); // VALUES () |
28 | | - errors.add("Function 'like' doesn't support search with non-constant needles in constant haystack"); |
29 | | - errors.add("Illegal type"); |
30 | | - errors.add("Illegal value (aggregate function) for positional argument in GROUP BY"); |
31 | | - errors.add("Invalid escape sequence at the end of LIKE pattern"); |
32 | | - errors.add("Invalid type for filter in"); |
33 | | - errors.add("Memory limit"); |
34 | | - errors.add("OptimizedRegularExpression: cannot compile re2"); |
35 | | - errors.add("Partition key cannot contain constants"); |
36 | | - errors.add("Positional argument out of bounds"); |
37 | | - errors.add("Sampling expression must be present in the primary key"); |
38 | | - errors.add("Sorting key cannot contain constants"); |
39 | | - errors.add("There is no supertype for types"); |
40 | | - errors.add("argument of function"); |
41 | | - errors.add("but its arguments considered equal according to constraints"); |
42 | | - errors.add("does not return a value of type UInt8"); |
43 | | - errors.add("doesn't exist"); // TODO: consecutive test runs can lead to dropped database |
44 | | - errors.add("in block. There are only columns:"); // https://github.com/ClickHouse/ClickHouse/issues/42399 |
45 | | - errors.add("invalid character class range"); |
46 | | - errors.add("invalid escape sequence"); |
47 | | - errors.add("is not under aggregate function and not in GROUP BY"); |
48 | | - errors.add("is not under aggregate function"); |
49 | | - errors.add("is violated at row 1. Expression:"); // TODO: check constraint on table creation |
50 | | - errors.add( |
51 | | - "is violated, because it is a constant expression returning 0. It is most likely an error in table definition"); |
52 | | - errors.add("there are only columns"); |
53 | | - errors.add("there are columns"); |
54 | | - errors.add("in block. (NOT_FOUND_COLUMN_IN_BLOCK)"); |
55 | | - errors.add("Missing columns"); |
56 | | - errors.add("Ambiguous column"); |
57 | | - errors.add("Must be one unsigned integer type. (ILLEGAL_TYPE_OF_COLUMN_FOR_FILTER)"); |
58 | | - errors.add("Floating point partition key is not supported"); |
59 | | - errors.add("Cannot get JOIN keys from JOIN ON section"); |
60 | | - errors.add("ILLEGAL_DIVISION"); |
61 | | - errors.add("DECIMAL_OVERFLOW"); |
62 | | - errors.add("Cannot convert out of range floating point value to integer type"); |
63 | | - errors.add("Unexpected inf or nan to integer conversion"); |
64 | | - errors.add("No such name in Block::erase"); // https://github.com/ClickHouse/ClickHouse/issues/42769 |
65 | | - errors.add("EMPTY_LIST_OF_COLUMNS_QUERIED"); // https://github.com/ClickHouse/ClickHouse/issues/43003 |
66 | | - errors.add("cannot get JOIN keys. (INVALID_JOIN_ON_EXPRESSION)"); |
67 | | - errors.add("AMBIGUOUS_IDENTIFIER"); |
68 | | - errors.add("CYCLIC_ALIASES"); |
69 | | - errors.add("Positional argument numeric constant expression is not representable as"); |
70 | | - errors.add("Positional argument must be constant with numeric type"); |
71 | | - errors.add(" is out of bounds. Expected in range"); |
72 | | - errors.add("with constants is not supported. (INVALID_JOIN_ON_EXPRESSION)"); |
73 | | - errors.add("Unexpected inf or nan to integer conversion"); |
74 | | - errors.add("Unsigned type must not contain"); |
75 | | - errors.add("Unexpected inf or nan to integer conversion"); |
| 12 | + public static List<String> getExpectedExpressionErrors() { |
| 13 | + return List.of("Argument at index 1 for function like must be constant", |
| 14 | + "Argument at index 1 for function notLike must be constant", |
| 15 | + "Attempt to read after eof: while converting", "Bad get: has Int64, requested UInt64", |
| 16 | + "Cannot convert string", "Cannot insert NULL value into a column of type", |
| 17 | + "Cannot parse Int32 from String, because value is too short", "Cannot parse NaN.: while converting", // https://github.com/ClickHouse/ClickHouse/issues/22710 |
| 18 | + "Cannot parse infinity.", "Cannot parse number with a sign character but without any numeric character", |
| 19 | + "Cannot parse number with multiple sign (+/-) characters or intermediate sign character", |
| 20 | + "Cannot parse string", "Cannot read floating point value", |
| 21 | + "Cyclic aliases: default expression and column type are incompatible", "Directory for table data", |
| 22 | + "Directory not empty", "Expected one of: compound identifier, identifier, list of elements (version", // VALUES |
| 23 | + // () |
| 24 | + "Function 'like' doesn't support search with non-constant needles in constant haystack", "Illegal type", |
| 25 | + "Illegal value (aggregate function) for positional argument in GROUP BY", |
| 26 | + "Invalid escape sequence at the end of LIKE pattern", "Invalid type for filter in", "Memory limit", |
| 27 | + "OptimizedRegularExpression: cannot compile re2", "Partition key cannot contain constants", |
| 28 | + "Positional argument out of bounds", "Sampling expression must be present in the primary key", |
| 29 | + "Sorting key cannot contain constants", "There is no supertype for types", "argument of function", |
| 30 | + "but its arguments considered equal according to constraints", "does not return a value of type UInt8", |
| 31 | + "doesn't exist", // TODO: consecutive test runs can lead to dropped database |
| 32 | + "in block. There are only columns:", // https://github.com/ClickHouse/ClickHouse/issues/42399 |
| 33 | + "invalid character class range", "invalid escape sequence", |
| 34 | + "is not under aggregate function and not in GROUP BY", "is not under aggregate function", |
| 35 | + "is violated at row 1. Expression:", // TODO: check constraint on table creation |
| 36 | + "is violated, because it is a constant expression returning 0. It is most likely an error in table definition", |
| 37 | + "there are only columns", "there are columns", "in block. (NOT_FOUND_COLUMN_IN_BLOCK)", |
| 38 | + "Missing columns", "Ambiguous column", |
| 39 | + "Must be one unsigned integer type. (ILLEGAL_TYPE_OF_COLUMN_FOR_FILTER)", |
| 40 | + "Floating point partition key is not supported", "Cannot get JOIN keys from JOIN ON section", |
| 41 | + "ILLEGAL_DIVISION", "DECIMAL_OVERFLOW", |
| 42 | + "Cannot convert out of range floating point value to integer type", |
| 43 | + "Unexpected inf or nan to integer conversion", "No such name in Block::erase", // https://github.com/ClickHouse/ClickHouse/issues/42769 |
| 44 | + "EMPTY_LIST_OF_COLUMNS_QUERIED", // https://github.com/ClickHouse/ClickHouse/issues/43003 |
| 45 | + "cannot get JOIN keys. (INVALID_JOIN_ON_EXPRESSION)", "AMBIGUOUS_IDENTIFIER", "CYCLIC_ALIASES", |
| 46 | + "Positional argument numeric constant expression is not representable as", |
| 47 | + "Positional argument must be constant with numeric type", " is out of bounds. Expected in range", |
| 48 | + "with constants is not supported. (INVALID_JOIN_ON_EXPRESSION)", |
| 49 | + "Unexpected inf or nan to integer conversion", "Unsigned type must not contain", |
| 50 | + "Unexpected inf or nan to integer conversion", |
76 | 51 |
|
77 | | - // The way we generate JOINs we can have ambiguous left table column without alias |
78 | | - // We may not count it as an issue, but it makes no sense to add more complex AST generation logic |
79 | | - errors.add("MULTIPLE_EXPRESSIONS_FOR_ALIAS"); |
80 | | - errors.add("AMBIGUOUS_IDENTIFIER"); // https://github.com/ClickHouse/ClickHouse/issues/45389 |
81 | | - errors.add("AMBIGUOUS_COLUMN_NAME"); // same https://github.com/ClickHouse/ClickHouse/issues/45389 |
82 | | - errors.add("Cannot parse number with multiple sign"); |
| 52 | + // The way we generate JOINs we can have ambiguous left table column without |
| 53 | + // alias |
| 54 | + // We may not count it as an issue, but it makes no sense to add more complex |
| 55 | + // AST generation logic |
| 56 | + "MULTIPLE_EXPRESSIONS_FOR_ALIAS", "AMBIGUOUS_IDENTIFIER", // https://github.com/ClickHouse/ClickHouse/issues/45389 |
| 57 | + "AMBIGUOUS_COLUMN_NAME", // same https://github.com/ClickHouse/ClickHouse/issues/45389 |
| 58 | + "Cannot parse number with multiple sign"); |
| 59 | + } |
| 60 | + |
| 61 | + public static void addExpectedExpressionErrors(ExpectedErrors errors) { |
| 62 | + errors.addAll(getExpectedExpressionErrors()); |
83 | 63 | } |
84 | 64 |
|
85 | 65 | } |
0 commit comments