forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5ad63ee
committed
pageinspect: Fix crash with gist_page_items()
Attempting to use this function with a raw page not coming from a GiSTindex would cause a crash, as it was missing the same sanity checks asgist_page_items_bytea(). This slightly refactors the code so as all thebasic validation checks for GiST pages are done in a single routine,in the same fashion as the pageinspect functions for hash and BRIN.This fixes an issue similar to076f4d9. A test is added to stress forthis case. While on it, I have added a similar test forbrin_page_items() with a combination make of a valid GiST index and araw btree page. This one was already protected, but it was not tested.Reported-by: Egor ChindyaskinAuthor: Dmitry KovalDiscussion:https://postgr.es/m/17815-fc4a2d3b74705703@postgresql.orgBackpatch-through: 141 parent1a9356f commit5ad63ee
File tree
5 files changed
+62
-56
lines changed- contrib/pageinspect
- expected
- sql
5 files changed
+62
-56
lines changedLines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
51 |
| - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
52 | 54 |
| |
53 | 55 |
| |
54 | 56 |
| |
55 |
| - | |
56 |
| - | |
| 57 | + | |
| 58 | + | |
57 | 59 |
| |
58 | 60 |
| |
59 | 61 |
| |
|
Lines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
66 | 66 |
| |
67 | 67 |
| |
68 | 68 |
| |
69 |
| - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
70 | 73 |
| |
71 | 74 |
| |
72 | 75 |
| |
| 76 | + | |
| 77 | + | |
73 | 78 |
| |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 | 79 |
| |
78 | 80 |
| |
79 | 81 |
| |
|
Lines changed: 40 additions & 42 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 |
| - | |
38 |
| - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
39 | 45 |
| |
40 |
| - | |
41 |
| - | |
42 |
| - | |
| 46 | + | |
43 | 47 |
| |
44 |
| - | |
45 |
| - | |
46 |
| - | |
47 |
| - | |
48 |
| - | |
49 |
| - | |
50 |
| - | |
51 |
| - | |
52 |
| - | |
53 |
| - | |
54 |
| - | |
55 |
| - | |
56 |
| - | |
57 | 48 |
| |
58 | 49 |
| |
59 |
| - | |
| 50 | + | |
60 | 51 |
| |
61 | 52 |
| |
62 | 53 |
| |
| |||
76 | 67 |
| |
77 | 68 |
| |
78 | 69 |
| |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
79 | 96 |
| |
80 | 97 |
| |
81 | 98 |
| |
82 | 99 |
| |
83 | 100 |
| |
84 |
| - | |
| 101 | + | |
85 | 102 |
| |
86 | 103 |
| |
87 | 104 |
| |
| |||
103 | 120 |
| |
104 | 121 |
| |
105 | 122 |
| |
106 |
| - | |
| 123 | + | |
107 | 124 |
| |
108 | 125 |
| |
109 | 126 |
| |
| |||
124 | 141 |
| |
125 | 142 |
| |
126 | 143 |
| |
127 |
| - | |
128 | 144 |
| |
129 | 145 |
| |
130 | 146 |
| |
| |||
157 | 173 |
| |
158 | 174 |
| |
159 | 175 |
| |
160 |
| - | |
| 176 | + | |
161 | 177 |
| |
162 | 178 |
| |
163 | 179 |
| |
164 | 180 |
| |
165 |
| - | |
166 |
| - | |
167 |
| - | |
168 |
| - | |
169 |
| - | |
170 |
| - | |
171 |
| - | |
172 |
| - | |
173 |
| - | |
174 |
| - | |
175 |
| - | |
176 |
| - | |
177 |
| - | |
178 |
| - | |
179 |
| - | |
180 |
| - | |
181 |
| - | |
182 |
| - | |
183 | 181 |
| |
184 | 182 |
| |
185 | 183 |
| |
| |||
276 | 274 |
| |
277 | 275 |
| |
278 | 276 |
| |
279 |
| - | |
| 277 | + | |
280 | 278 |
| |
281 | 279 |
| |
282 | 280 |
| |
|
Lines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 |
| - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 |
| |
20 | 23 |
| |
| 24 | + | |
21 | 25 |
| |
22 |
| - | |
23 |
| - | |
24 | 26 |
| |
25 | 27 |
| |
26 | 28 |
| |
|
Lines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
29 |
| - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 |
| |
31 | 35 |
| |
| 36 | + | |
32 | 37 |
| |
33 | 38 |
| |
34 |
| - | |
35 |
| - | |
36 |
| - | |
37 | 39 |
| |
38 | 40 |
| |
39 | 41 |
| |
|
0 commit comments
Comments
(0)