Repository navigation
Commit 5796b90
committed
fix: end block comments at the first */ for dialects that do not nest
consumeBlockCommentBody honoured nested block comments under every
dialect, so a /* inside a comment opened another level and the comment
ran on to a later */. MySQL, MariaDB, SQLite, Oracle, BigQuery and
Spanner end a block comment at the first */ and run what follows it,
so with Dialect.MYSQL the parser returned SELECT 1 for
SELECT 1 /* a /* b */ + 2 -- */, which the server evaluates as
SELECT 1 + 2.
Dialect gains isNestedBlockComments(), false for those six dialects,
and the token manager nests only when the configured dialect does.
Without a dialect, and for PostgreSQL, SQL Server, H2 and the other
dialects, nesting is unchanged.1 parent 7123d25 commit 5796b90
3 files changed
Lines changed: 67 additions & 4 deletions
File tree
- src
- main
- java/net/sf/jsqlparser/parser
- jjtree/net/sf/jsqlparser/parser
- test/java/net/sf/jsqlparser/statement/select
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
| |||
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
75 | 89 | | |
76 | 90 | | |
77 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3918 | 3918 | | |
3919 | 3919 | | |
3920 | 3920 | | |
3921 | | - | |
3922 | | - | |
3923 | | - | |
| 3921 | + | |
| 3922 | + | |
| 3923 | + | |
3924 | 3924 | | |
3925 | 3925 | | |
| 3926 | + | |
3926 | 3927 | | |
3927 | 3928 | | |
3928 | 3929 | | |
3929 | 3930 | | |
3930 | 3931 | | |
3931 | | - | |
| 3932 | + | |
3932 | 3933 | | |
3933 | 3934 | | |
3934 | 3935 | | |
| |||
3944 | 3945 | | |
3945 | 3946 | | |
3946 | 3947 | | |
| 3948 | + | |
| 3949 | + | |
| 3950 | + | |
| 3951 | + | |
| 3952 | + | |
| 3953 | + | |
| 3954 | + | |
| 3955 | + | |
| 3956 | + | |
| 3957 | + | |
| 3958 | + | |
| 3959 | + | |
3947 | 3960 | | |
3948 | 3961 | | |
3949 | 3962 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
102 | 106 | | |
103 | 107 | | |
104 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
105 | 141 | | |
0 commit comments