forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitec26900
committed
Fix grammar for subscripting or field selection from a sub-SELECT result.
Such cases should work, but the grammar failed to accept them because ofour ancient precedence hacks to convince bison that extra parenthesesaround a sub-SELECT in an expression are unambiguous. (Formally, they*are* ambiguous, but we don't especially care whether they're treated aspart of the sub-SELECT or part of the expression. Bison cares, though.)Fix by adding a redundant-looking production for this case.This is a fine example of why fixing shift/reduce conflicts viaprecedence declarations is more dangerous than it looks: you can easilycause the parser to reject cases that should work.This has been wrong since commit3db4056or maybe before, and apparently some people have been working around itby inserting no-op casts. That method introduces a dump/reload hazard,as illustrated in bug #7838 from Jan Mate. Hence, back-patch to allactive branches.1 parent3eae794 commitec26900
File tree
3 files changed
+93
-0
lines changed- src
- backend/parser
- test/regress
- expected
- sql
3 files changed
+93
-0
lines changedLines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10232 | 10232 |
| |
10233 | 10233 |
| |
10234 | 10234 |
| |
| 10235 | + | |
| 10236 | + | |
| 10237 | + | |
| 10238 | + | |
| 10239 | + | |
| 10240 | + | |
| 10241 | + | |
| 10242 | + | |
| 10243 | + | |
| 10244 | + | |
| 10245 | + | |
| 10246 | + | |
| 10247 | + | |
| 10248 | + | |
| 10249 | + | |
| 10250 | + | |
| 10251 | + | |
| 10252 | + | |
| 10253 | + | |
| 10254 | + | |
| 10255 | + | |
| 10256 | + | |
| 10257 | + | |
10235 | 10258 |
| |
10236 | 10259 |
| |
10237 | 10260 |
| |
|
Lines changed: 55 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 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 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
20 | 75 |
| |
21 | 76 |
| |
22 | 77 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
11 | 26 |
| |
12 | 27 |
| |
13 | 28 |
| |
|
0 commit comments
Comments
(0)