forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf4e7ae2
committed
Fix SP-GiST scan initialization logic for binary-compatible cases.
Commitac9099f rearranged the logic in spgGetCache() that determinesthe index's attType (nominal input data type) and leafType (actualtype stored in leaf index tuples). Turns out this broke things forthe case where (a) the actual input data type is different from thenominal type, (b) the opclass's config function leaves leafTypedefaulted, and (c) the opclass has no "compress" function. (b) causedus to assign the actual input data type as leafType, and then sincethat's not attType, we complained that a "compress" function isrequired. For non-polymorphic opclasses, condition (a) arises inbinary-compatible cases, such as using SP-GiST text_ops for a varcharcolumn, or using any opclass on a domain over its nominal input type.To fix, use attType for leafType when the index's declared column typeis different from but binary-compatible with attType. Do this only inthe defaulted-leafType case, to avoid overriding any explicitselection made by the opclass.Per bug #17294 from Ilya Anfimov. Back-patch to v14.Discussion:https://postgr.es/m/17294-8f6c7962ce877edc@postgresql.org1 parent46d665b commitf4e7ae2
File tree
3 files changed
+42
-0
lines changed- src
- backend/access/spgist
- test/regress
- expected
- sql
3 files changed
+42
-0
lines changedLines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| 28 | + | |
28 | 29 |
| |
29 | 30 |
| |
30 | 31 |
| |
| |||
218 | 219 |
| |
219 | 220 |
| |
220 | 221 |
| |
| 222 | + | |
221 | 223 |
| |
222 | 224 |
| |
223 | 225 |
| |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
224 | 236 |
| |
225 | 237 |
| |
226 | 238 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
65 | 65 |
| |
66 | 66 |
| |
67 | 67 |
| |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + |
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + |
0 commit comments
Comments
(0)