- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit66e6916
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 parent85abf1d commit66e6916
File tree
3 files changed
+92
-0
lines changed- src
- backend/parser
- test/regress
- expected
- sql
3 files changed
+92
-0
lines changedLines changed: 22 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7786 | 7786 |
| |
7787 | 7787 |
| |
7788 | 7788 |
| |
| 7789 | + | |
| 7790 | + | |
| 7791 | + | |
| 7792 | + | |
| 7793 | + | |
| 7794 | + | |
| 7795 | + | |
| 7796 | + | |
| 7797 | + | |
| 7798 | + | |
| 7799 | + | |
| 7800 | + | |
| 7801 | + | |
| 7802 | + | |
| 7803 | + | |
| 7804 | + | |
| 7805 | + | |
| 7806 | + | |
| 7807 | + | |
| 7808 | + | |
| 7809 | + | |
| 7810 | + | |
7789 | 7811 |
| |
7790 | 7812 |
| |
7791 | 7813 |
| |
|
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)