Commit 9c8a037
David Hayes
Fix[2290] - Fix overeager lambda function parsing
`SELECT DATE_TRUNC('week',("schema"."tbl"."column" + INTERVAL '1 day')) FROM "schema"."tbl";`
is parsing the `("schema"."tbl"."column" + INTERVAL '1 day')` as a LambdaFunction incorrectly, and crashes out. Increasing the lookahead depth by 1 ensures it fails to match on the `->` keyword (I believe), and falls into a simple expression instead.
JMH
```
jmh {
includes = ['.*JSQLParserBenchmark.*']
warmupIterations = 2
fork = 5
iterations = 5
timeOnIteration = '5s'
}
```
After:
```
33.970 ±(99.9%) 1.773 ms/op [Average]
(min, avg, max) = (31.405, 33.970, 37.302), stdev = 2.367
CI (99.9%): [32.197, 35.743] (assumes normal distribution)
```
Before:
```
34.882 ±(99.9%) 1.923 ms/op [Average]
(min, avg, max) = (31.191, 34.882, 37.406), stdev = 2.567
CI (99.9%): [32.959, 36.805] (assumes normal distribution)
```1 parent 5ab6527 commit 9c8a037
File tree
2 files changed
+5
-3
lines changed- src
- main/jjtree/net/sf/jsqlparser/parser
- test/resources
2 files changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5979 | 5979 | | |
5980 | 5980 | | |
5981 | 5981 | | |
5982 | | - | |
| 5982 | + | |
5983 | 5983 | | |
5984 | 5984 | | |
5985 | 5985 | | |
| |||
6038 | 6038 | | |
6039 | 6039 | | |
6040 | 6040 | | |
6041 | | - | |
| 6041 | + | |
6042 | 6042 | | |
6043 | 6043 | | |
6044 | 6044 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
0 commit comments