forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite1fd61c
committed
Ensure casting to typmod -1 generates a RelabelType.
Fix the code changed by commit5c056b0 so that we always generateRelabelType, not something else, for a cast to unspecified typmod.Otherwise planner optimizations might not happen.It appears we missed this point because the previous experiments weredone on type numeric: the parser undesirably generates a call on thenumeric() length-coercion function, but then numeric_support()optimizes that down to a RelabelType, so that everything seems fine.It misbehaves for types that have a non-optimized length coercionfunction, such as bpchar.Per report from John Naylor. Back-patch to all supported branches,as the previous patch eventually was. Unfortunately, that no longerincludes 9.6 ... we really shouldn't put this type of change into anearly-EOL branch.Discussion:https://postgr.es/m/CAFBsxsEfbFHEkouc+FSj+3K1sHipLPbEC67L0SAe-9-da8QtYg@mail.gmail.com1 parentf04aa65 commite1fd61c
File tree
3 files changed
+61
-1
lines changed- src
- backend/parser
- test/regress
- expected
- sql
3 files changed
+61
-1
lines changedLines changed: 9 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
760 | 760 |
| |
761 | 761 |
| |
762 | 762 |
| |
763 |
| - | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
764 | 772 |
| |
765 | 773 |
| |
766 | 774 |
| |
|
Lines changed: 36 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
111 | 111 |
| |
112 | 112 |
| |
113 | 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 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
114 | 150 |
|
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
56 | 72 |
|
0 commit comments
Comments
(0)