forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2d8bff6
committed
Make all ereport() calls within gram.y provide error locations.
This patch responds to a comment that I (tgl) made in thediscussion leading up to774171c, that really all errorsoccurring during raw parsing should provide error cursors.Syntax errors reported by Bison will have one, and most ofthe handwritten ereport's in gram.y already provide one,but there were a few stragglers.(It is not claimed that this handles every failure reachableduring raw parsing --- out-of-memory is an obvious exception.But this makes a good start on cases that are likely to occur.)While we're at it, clean up the reported positions for errorsassociated with LIMIT/OFFSET clauses. Previously we wererelying on applying exprLocation() to the contained expressions,but that leads to slightly odd cursor placement, e.g.regression=# (select * from foo limit 10) limit 10;ERROR: multiple LIMIT clauses not allowedLINE 1: (select * from foo limit 10) limit 10; ^We can afford to keep a little more state in the transientSelectLimit structs in order to make that better.Jian He and Tom Lane (extracted from a larger patch by Jian,with some additional work by me)Discussion:https://postgr.es/m/CACJufxEmONE3P2En=jopZy1m=cCCUs65M4+1o52MW5og9oaUPA@mail.gmail.com1 parent89e51ab commit2d8bff6
File tree
4 files changed
+62
-22
lines changed- src
- backend/parser
- test/regress/expected
4 files changed
+62
-22
lines changedLines changed: 52 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
105 | 105 |
| |
106 | 106 |
| |
107 | 107 |
| |
108 |
| - | |
| 108 | + | |
109 | 109 |
| |
110 | 110 |
| |
111 | 111 |
| |
112 | 112 |
| |
113 |
| - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
114 | 117 |
| |
115 | 118 |
| |
116 | 119 |
| |
| |||
195 | 198 |
| |
196 | 199 |
| |
197 | 200 |
| |
198 |
| - | |
| 201 | + | |
| 202 | + | |
199 | 203 |
| |
200 | 204 |
| |
201 | 205 |
| |
| |||
3145 | 3149 |
| |
3146 | 3150 |
| |
3147 | 3151 |
| |
3148 |
| - | |
| 3152 | + | |
| 3153 | + | |
3149 | 3154 |
| |
3150 | 3155 |
| |
3151 | 3156 |
| |
3152 |
| - | |
| 3157 | + | |
| 3158 | + | |
3153 | 3159 |
| |
3154 | 3160 |
| |
3155 | 3161 |
| |
| |||
4528 | 4534 |
| |
4529 | 4535 |
| |
4530 | 4536 |
| |
4531 |
| - | |
| 4537 | + | |
4532 | 4538 |
| |
4533 | 4539 |
| |
4534 | 4540 |
| |
| |||
5962 | 5968 |
| |
5963 | 5969 |
| |
5964 | 5970 |
| |
5965 |
| - | |
| 5971 | + | |
| 5972 | + | |
5966 | 5973 |
| |
5967 | 5974 |
| |
5968 | 5975 |
| |
| |||
6247 | 6254 |
| |
6248 | 6255 |
| |
6249 | 6256 |
| |
6250 |
| - | |
| 6257 | + | |
| 6258 | + | |
6251 | 6259 |
| |
6252 | 6260 |
| |
6253 | 6261 |
| |
| |||
13156 | 13164 |
| |
13157 | 13165 |
| |
13158 | 13166 |
| |
| 13167 | + | |
13159 | 13168 |
| |
13160 | 13169 |
| |
13161 | 13170 |
| |
13162 | 13171 |
| |
13163 | 13172 |
| |
| 13173 | + | |
13164 | 13174 |
| |
13165 | 13175 |
| |
13166 | 13176 |
| |
| |||
13173 | 13183 |
| |
13174 | 13184 |
| |
13175 | 13185 |
| |
| 13186 | + | |
| 13187 | + | |
| 13188 | + | |
13176 | 13189 |
| |
13177 | 13190 |
| |
13178 | 13191 |
| |
| |||
13190 | 13203 |
| |
13191 | 13204 |
| |
13192 | 13205 |
| |
| 13206 | + | |
| 13207 | + | |
| 13208 | + | |
13193 | 13209 |
| |
13194 | 13210 |
| |
13195 | 13211 |
| |
| |||
13215 | 13231 |
| |
13216 | 13232 |
| |
13217 | 13233 |
| |
| 13234 | + | |
| 13235 | + | |
| 13236 | + | |
13218 | 13237 |
| |
13219 | 13238 |
| |
13220 | 13239 |
| |
| |||
13224 | 13243 |
| |
13225 | 13244 |
| |
13226 | 13245 |
| |
| 13246 | + | |
| 13247 | + | |
| 13248 | + | |
13227 | 13249 |
| |
13228 | 13250 |
| |
13229 | 13251 |
| |
| |||
13233 | 13255 |
| |
13234 | 13256 |
| |
13235 | 13257 |
| |
| 13258 | + | |
| 13259 | + | |
| 13260 | + | |
13236 | 13261 |
| |
13237 | 13262 |
| |
13238 | 13263 |
| |
| |||
13242 | 13267 |
| |
13243 | 13268 |
| |
13244 | 13269 |
| |
| 13270 | + | |
| 13271 | + | |
| 13272 | + | |
13245 | 13273 |
| |
13246 | 13274 |
| |
13247 | 13275 |
| |
| |||
16954 | 16982 |
| |
16955 | 16983 |
| |
16956 | 16984 |
| |
16957 |
| - | |
16958 |
| - | |
| 16985 | + | |
| 16986 | + | |
| 16987 | + | |
16959 | 16988 |
| |
16960 | 16989 |
| |
16961 | 16990 |
| |
| |||
17457 | 17486 |
| |
17458 | 17487 |
| |
17459 | 17488 |
| |
17460 |
| - | |
| 17489 | + | |
| 17490 | + | |
17461 | 17491 |
| |
17462 | 17492 |
| |
17463 | 17493 |
| |
| |||
18962 | 18992 |
| |
18963 | 18993 |
| |
18964 | 18994 |
| |
18965 |
| - | |
| 18995 | + | |
18966 | 18996 |
| |
18967 | 18997 |
| |
18968 | 18998 |
| |
| |||
18971 | 19001 |
| |
18972 | 19002 |
| |
18973 | 19003 |
| |
18974 |
| - | |
| 19004 | + | |
18975 | 19005 |
| |
18976 | 19006 |
| |
18977 | 19007 |
| |
18978 | 19008 |
| |
18979 |
| - | |
18980 |
| - | |
18981 |
| - | |
18982 |
| - | |
| 19009 | + | |
| 19010 | + | |
18983 | 19011 |
| |
18984 | 19012 |
| |
18985 | 19013 |
| |
18986 |
| - | |
| 19014 | + | |
| 19015 | + | |
18987 | 19016 |
| |
18988 | 19017 |
| |
18989 | 19018 |
| |
| |||
18996 | 19025 |
| |
18997 | 19026 |
| |
18998 | 19027 |
| |
18999 |
| - | |
| 19028 | + | |
| 19029 | + | |
19000 | 19030 |
| |
19001 | 19031 |
| |
19002 | 19032 |
| |
| |||
19425 | 19455 |
| |
19426 | 19456 |
| |
19427 | 19457 |
| |
19428 |
| - | |
| 19458 | + | |
19429 | 19459 |
| |
19430 | 19460 |
| |
19431 | 19461 |
| |
| |||
19436 | 19466 |
| |
19437 | 19467 |
| |
19438 | 19468 |
| |
19439 |
| - | |
19440 |
| - | |
| 19469 | + | |
| 19470 | + | |
19441 | 19471 |
| |
19442 | 19472 |
| |
19443 | 19473 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
198 | 198 |
| |
199 | 199 |
| |
200 | 200 |
| |
| 201 | + | |
| 202 | + | |
201 | 203 |
| |
202 | 204 |
| |
203 | 205 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
624 | 624 |
| |
625 | 625 |
| |
626 | 626 |
| |
| 627 | + | |
| 628 | + | |
627 | 629 |
| |
628 | 630 |
| |
629 | 631 |
| |
630 | 632 |
| |
631 | 633 |
| |
| 634 | + | |
| 635 | + | |
632 | 636 |
| |
633 | 637 |
| |
634 | 638 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
337 | 337 |
| |
338 | 338 |
| |
339 | 339 |
| |
| 340 | + | |
| 341 | + | |
340 | 342 |
| |
341 | 343 |
| |
342 | 344 |
| |
| |||
620 | 622 |
| |
621 | 623 |
| |
622 | 624 |
| |
| 625 | + | |
| 626 | + | |
623 | 627 |
| |
624 | 628 |
| |
625 | 629 |
| |
|
0 commit comments
Comments
(0)