Repository navigation
Commit 6d0d61e
Jules Ivanic
Let a dialect declare which reserved keywords it accepts as names, starting with DuckDB
Reserved keywords are global: a keyword reserved for one dialect's syntax (ClickHouse's
PREWHERE and SETTINGS, Exasol's FILE and SCRIPT, MySQL's XOR, ...) is rejected as a name
in every dialect, although DuckDB, for instance, does not know these words and uses them
as plain column and table names.
- `Dialect#getUnreservedKeywords()`: the keywords reserved by default that a dialect
accepts as unquoted names. New `Dialect.DUCKDB` (dollar-quoted string tags, adjacent
string literals on a new line) declares 24: the 23 that DuckDB 1.5.5's
`duckdb_keywords()` does not know, plus its unreserved CSV. MySQL's SELECT modifiers
(DISTINCTROW, STRAIGHT_JOIN, SQL_CACHE, ...) stay reserved: the syntactic lookahead into a
SELECT takes them as modifiers before any name.
- `RelObjectName()` accepts them through `DialectUnreservedWord()` when the configured
dialect does, and the identifier checks (`isAliasAhead()`, `canEndExpression()`, ...)
consult the same set; the XOR operator, INCLUDES/EXCLUDES conditions and the
CONNECT_BY_ROOT operator step aside for them.
- Without a dialect, or with any other one, nothing changes.
- `TaggedDollarStringTest` treats every dialect enabling dollar-quoted string tags, now
including DuckDB, like PostgreSQL.1 parent 166f0a2 commit 6d0d61e
4 files changed
Lines changed: 152 additions & 11 deletions
File tree
- src
- main
- java/net/sf/jsqlparser/parser
- jjtree/net/sf/jsqlparser/parser
- test/java/net/sf/jsqlparser
- expression
- statement
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
51 | 69 | | |
52 | 70 | | |
53 | 71 | | |
| |||
70 | 88 | | |
71 | 89 | | |
72 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
73 | 99 | | |
74 | 100 | | |
75 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
| 432 | + | |
432 | 433 | | |
433 | 434 | | |
434 | 435 | | |
| |||
619 | 620 | | |
620 | 621 | | |
621 | 622 | | |
622 | | - | |
| 623 | + | |
623 | 624 | | |
624 | 625 | | |
625 | 626 | | |
| |||
797 | 798 | | |
798 | 799 | | |
799 | 800 | | |
800 | | - | |
| 801 | + | |
801 | 802 | | |
802 | 803 | | |
803 | 804 | | |
| |||
810 | 811 | | |
811 | 812 | | |
812 | 813 | | |
813 | | - | |
| 814 | + | |
| 815 | + | |
814 | 816 | | |
815 | 817 | | |
816 | 818 | | |
| |||
1175 | 1177 | | |
1176 | 1178 | | |
1177 | 1179 | | |
1178 | | - | |
| 1180 | + | |
| 1181 | + | |
1179 | 1182 | | |
1180 | 1183 | | |
1181 | 1184 | | |
| |||
1505 | 1508 | | |
1506 | 1509 | | |
1507 | 1510 | | |
1508 | | - | |
| 1511 | + | |
| 1512 | + | |
1509 | 1513 | | |
1510 | 1514 | | |
1511 | 1515 | | |
| |||
1532 | 1536 | | |
1533 | 1537 | | |
1534 | 1538 | | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
1535 | 1542 | | |
1536 | 1543 | | |
1537 | 1544 | | |
| |||
1611 | 1618 | | |
1612 | 1619 | | |
1613 | 1620 | | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
1614 | 1632 | | |
1615 | 1633 | | |
1616 | 1634 | | |
| |||
2185 | 2203 | | |
2186 | 2204 | | |
2187 | 2205 | | |
| 2206 | + | |
2188 | 2207 | | |
2189 | 2208 | | |
2190 | 2209 | | |
| |||
6838 | 6857 | | |
6839 | 6858 | | |
6840 | 6859 | | |
| 6860 | + | |
| 6861 | + | |
| 6862 | + | |
| 6863 | + | |
6841 | 6864 | | |
6842 | 6865 | | |
6843 | 6866 | | |
| |||
6865 | 6888 | | |
6866 | 6889 | | |
6867 | 6890 | | |
| 6891 | + | |
| 6892 | + | |
| 6893 | + | |
| 6894 | + | |
| 6895 | + | |
| 6896 | + | |
| 6897 | + | |
| 6898 | + | |
| 6899 | + | |
| 6900 | + | |
| 6901 | + | |
| 6902 | + | |
| 6903 | + | |
| 6904 | + | |
| 6905 | + | |
| 6906 | + | |
| 6907 | + | |
6868 | 6908 | | |
6869 | 6909 | | |
6870 | 6910 | | |
| |||
9693 | 9733 | | |
9694 | 9734 | | |
9695 | 9735 | | |
9696 | | - | |
| 9736 | + | |
9697 | 9737 | | |
9698 | 9738 | | |
9699 | 9739 | | |
9700 | 9740 | | |
9701 | 9741 | | |
9702 | 9742 | | |
9703 | | - | |
| 9743 | + | |
9704 | 9744 | | |
9705 | 9745 | | |
9706 | 9746 | | |
| |||
10394 | 10434 | | |
10395 | 10435 | | |
10396 | 10436 | | |
10397 | | - | |
| 10437 | + | |
10398 | 10438 | | |
10399 | 10439 | | |
10400 | 10440 | | |
| |||
11428 | 11468 | | |
11429 | 11469 | | |
11430 | 11470 | | |
11431 | | - | |
| 11471 | + | |
| 11472 | + | |
11432 | 11473 | | |
11433 | 11474 | | |
11434 | 11475 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
97 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
0 commit comments