forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitac9099f
committed
Fix confusion in SP-GiST between attribute type and leaf storage type.
According to the documentation, the attType passed to the opclassconfig function (and also relied on by the core code) is the typeof the heap column or expression being indexed. But what wasactually being passed was the type stored for the index column.This made no difference for user-defined SP-GiST opclasses,because we weren't allowing the STORAGE clause of CREATE OPCLASSto be used, so the two types would be the same. But it's sillynot to allow that, seeing that the built-in poly_ops opclasshas a different value for opckeytype than opcintype, and that if youwant to do lossy storage then the types must really be different.(Thus, user-defined opclasses doing lossy storage had to lie aboutwhat type is in the index.) Hence, remove the restriction, and makesure that we use the input column type not opckeytype where relevant.For reasons of backwards compatibility with existing user-definedopclasses, we can't quite insist that the specified leafType matchthe STORAGE clause; instead just add an amvalidate() warning ifthey don't match.Also fix some bugs that would only manifest when trying to returnindex entries when attType is different from attLeafType. It's nottoo surprising that these have not been reported, because the onlyusual reason for such a difference is to store the leaf valuelossily, rendering index-only scans impossible.Add a src/test/modules module to exercise cases where attType isdifferent from attLeafType and yet index-only scan is supported.Discussion:https://postgr.es/m/3728741.1617381471@sss.pgh.pa.us1 parentd9c5b9a commitac9099f
File tree
17 files changed
+937
-44
lines changed- doc/src/sgml
- ref
- src
- backend/access/spgist
- include/access
- test
- modules
- spgist_name_ops
- expected
- sql
- regress
- expected
- sql
17 files changed
+937
-44
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
234 | 234 |
| |
235 | 235 |
| |
236 | 236 |
| |
237 |
| - | |
| 237 | + | |
238 | 238 |
| |
239 | 239 |
| |
240 | 240 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
205 | 205 |
| |
206 | 206 |
| |
207 | 207 |
| |
208 |
| - | |
209 |
| - | |
210 |
| - | |
211 |
| - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
212 | 214 |
| |
213 | 215 |
| |
214 | 216 |
| |
| |||
330 | 332 |
| |
331 | 333 |
| |
332 | 334 |
| |
333 |
| - | |
334 |
| - | |
335 |
| - | |
336 |
| - | |
337 |
| - | |
338 |
| - | |
339 |
| - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
340 | 354 |
| |
341 | 355 |
| |
342 | 356 |
| |
343 | 357 |
| |
344 |
| - | |
345 |
| - | |
346 | 358 |
| |
347 | 359 |
| |
348 | 360 |
| |
| |||
677 | 689 |
| |
678 | 690 |
| |
679 | 691 |
| |
680 |
| - | |
681 |
| - | |
| 692 | + | |
682 | 693 |
| |
683 | 694 |
| |
684 | 695 |
| |
| |||
713 | 724 |
| |
714 | 725 |
| |
715 | 726 |
| |
716 |
| - | |
717 | 727 |
| |
718 | 728 |
| |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
719 | 735 |
| |
720 | 736 |
| |
721 | 737 |
| |
| |||
797 | 813 |
| |
798 | 814 |
| |
799 | 815 |
| |
800 |
| - | |
801 |
| - | |
| 816 | + | |
802 | 817 |
| |
803 | 818 |
| |
804 | 819 |
| |
| |||
816 | 831 |
| |
817 | 832 |
| |
818 | 833 |
| |
819 |
| - | |
820 |
| - | |
| 834 | + | |
| 835 | + | |
821 | 836 |
| |
822 | 837 |
| |
823 | 838 |
| |
| |||
834 | 849 |
| |
835 | 850 |
| |
836 | 851 |
| |
837 |
| - | |
| 852 | + | |
838 | 853 |
| |
839 | 854 |
| |
840 | 855 |
| |
841 | 856 |
| |
842 | 857 |
| |
843 | 858 |
| |
844 | 859 |
| |
845 |
| - | |
846 |
| - | |
| 860 | + | |
| 861 | + | |
847 | 862 |
| |
848 |
| - | |
849 |
| - | |
850 |
| - | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
851 | 872 |
| |
852 | 873 |
| |
853 | 874 |
| |
| 875 | + | |
854 | 876 |
| |
855 | 877 |
| |
856 | 878 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
81 | 81 |
| |
82 | 82 |
| |
83 | 83 |
| |
84 |
| - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
85 | 88 |
| |
86 | 89 |
| |
87 | 90 |
| |
| |||
296 | 299 |
| |
297 | 300 |
| |
298 | 301 |
| |
| 302 | + | |
299 | 303 |
| |
300 | 304 |
| |
301 | 305 |
| |
| |||
314 | 318 |
| |
315 | 319 |
| |
316 | 320 |
| |
317 |
| - | |
318 |
| - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
319 | 336 |
| |
320 | 337 |
| |
321 | 338 |
| |
| |||
447 | 464 |
| |
448 | 465 |
| |
449 | 466 |
| |
| 467 | + | |
450 | 468 |
| |
451 |
| - | |
452 |
| - | |
| 469 | + | |
| 470 | + | |
453 | 471 |
| |
454 | 472 |
| |
455 | 473 |
| |
| |||
497 | 515 |
| |
498 | 516 |
| |
499 | 517 |
| |
| 518 | + | |
500 | 519 |
| |
501 | 520 |
| |
502 | 521 |
| |
| |||
563 | 582 |
| |
564 | 583 |
| |
565 | 584 |
| |
| 585 | + | |
566 | 586 |
| |
567 | 587 |
| |
568 | 588 |
| |
| |||
589 | 609 |
| |
590 | 610 |
| |
591 | 611 |
| |
| 612 | + | |
592 | 613 |
| |
593 | 614 |
| |
594 | 615 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
| 26 | + | |
26 | 27 |
| |
27 | 28 |
| |
28 | 29 |
| |
| |||
53 | 54 |
| |
54 | 55 |
| |
55 | 56 |
| |
56 |
| - | |
| 57 | + | |
57 | 58 |
| |
58 | 59 |
| |
59 | 60 |
| |
| |||
89 | 90 |
| |
90 | 91 |
| |
91 | 92 |
| |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 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 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
92 | 153 |
| |
93 | 154 |
| |
94 | 155 |
| |
| |||
121 | 182 |
| |
122 | 183 |
| |
123 | 184 |
| |
124 |
| - | |
125 |
| - | |
| 185 | + | |
| 186 | + | |
126 | 187 |
| |
127 | 188 |
| |
128 |
| - | |
| 189 | + | |
129 | 190 |
| |
130 | 191 |
| |
131 | 192 |
| |
| |||
136 | 197 |
| |
137 | 198 |
| |
138 | 199 |
| |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
139 | 211 |
| |
140 | 212 |
| |
141 | 213 |
| |
142 |
| - | |
143 |
| - | |
| 214 | + | |
144 | 215 |
| |
145 | 216 |
| |
146 | 217 |
| |
| |||
151 | 222 |
| |
152 | 223 |
| |
153 | 224 |
| |
| 225 | + | |
154 | 226 |
| |
155 | 227 |
| |
156 | 228 |
| |
|
0 commit comments
Comments
(0)