forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitda0d8a4
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 parentaadbf82 commitda0d8a4
File tree
3 files changed
+61
-1
lines changed- src
- backend/parser
- test/regress
- expected
- sql
3 files changed
+61
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
763 | 763 | | |
764 | 764 | | |
765 | 765 | | |
766 | | - | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
767 | 775 | | |
768 | 776 | | |
769 | 777 | | |
| |||
| 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 | | |
| 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 | | |
0 commit comments
Comments
(0)