forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9c356f4
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 parentcf0cab8 commit9c356f4
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 | |
---|---|---|---|
| |||
766 | 766 |
| |
767 | 767 |
| |
768 | 768 |
| |
769 |
| - | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
770 | 778 |
| |
771 | 779 |
| |
772 | 780 |
| |
|
Lines changed: 36 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
194 | 194 |
| |
195 | 195 |
| |
196 | 196 |
| |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
197 | 233 |
| |
198 | 234 |
| |
199 | 235 |
| |
|
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
84 | 84 |
| |
85 | 85 |
| |
86 | 86 |
| |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
87 | 103 |
| |
88 | 104 |
| |
89 | 105 |
| |
|
0 commit comments
Comments
(0)