forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit23d0b48
committed
Remove hardcoded hash opclass function signature exceptions
hashvalidate(), which validates the signatures of support functionsfor the hash AM, contained several hardcoded exceptions. For example,hash/date_ops support function 1 was hashint4(), which wouldordinarily fail validation because the function argument is int4, notdate. But this works internally because int4 and date are of the samesize. There are several more exceptions like this that happen to workand were allowed historically but would now fail the functionsignature validation.This patch removes those exceptions by providing new support functionsthat have the proper declared signatures. They internally share mostof the code with the "wrong" functions they replace, so the behavioris still the same.With the exceptions gone, hashvalidate() is now simplified and reliesfully on check_amproc_signature().hashvarlena() and hashvarlenaextended() are kept in pg_proc.datbecause some extensions currently use them to build hash functions fortheir own types, and we need to keep exposing these functions as"LANGUAGE internal" functions for that to continue to work.Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://www.postgresql.org/message-id/flat/29c3b746-69e7-482a-b37c-dbbf7e5b009b@eisentraut.org1 parent5bb9ba2 commit23d0b48
File tree
9 files changed
+174
-122
lines changed- src
- backend
- access/hash
- utils/adt
- include/catalog
9 files changed
+174
-122
lines changedLines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
376 | 376 |
| |
377 | 377 |
| |
378 | 378 |
| |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
379 | 384 |
| |
380 | 385 |
| |
381 | 386 |
| |
| |||
406 | 411 |
| |
407 | 412 |
| |
408 | 413 |
| |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + |
Lines changed: 25 additions & 105 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
26 | 25 |
| |
27 |
| - | |
28 | 26 |
| |
29 |
| - | |
30 | 27 |
| |
31 | 28 |
| |
32 | 29 |
| |
33 | 30 |
| |
34 | 31 |
| |
35 |
| - | |
36 |
| - | |
37 |
| - | |
38 | 32 |
| |
39 | 33 |
| |
40 | 34 |
| |
| |||
90 | 84 |
| |
91 | 85 |
| |
92 | 86 |
| |
| 87 | + | |
93 | 88 |
| |
94 | 89 |
| |
95 | 90 |
| |
| |||
109 | 104 |
| |
110 | 105 |
| |
111 | 106 |
| |
| 107 | + | |
| 108 | + | |
| 109 | + | |
112 | 110 |
| |
113 |
| - | |
114 |
| - | |
115 |
| - | |
116 |
| - | |
117 |
| - | |
118 |
| - | |
119 |
| - | |
120 |
| - | |
121 |
| - | |
122 |
| - | |
123 |
| - | |
124 |
| - | |
125 |
| - | |
126 |
| - | |
127 |
| - | |
128 |
| - | |
129 |
| - | |
130 |
| - | |
| 111 | + | |
| 112 | + | |
131 | 113 |
| |
132 | 114 |
| |
133 |
| - | |
134 |
| - | |
| 115 | + | |
135 | 116 |
| |
136 | 117 |
| |
137 | 118 |
| |
| |||
141 | 122 |
| |
142 | 123 |
| |
143 | 124 |
| |
144 |
| - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
145 | 143 |
| |
146 | 144 |
| |
147 | 145 |
| |
| |||
267 | 265 |
| |
268 | 266 |
| |
269 | 267 |
| |
270 |
| - | |
271 |
| - | |
272 |
| - | |
273 |
| - | |
274 |
| - | |
275 |
| - | |
276 |
| - | |
277 |
| - | |
278 |
| - | |
279 |
| - | |
280 |
| - | |
281 |
| - | |
282 |
| - | |
283 |
| - | |
284 |
| - | |
285 |
| - | |
286 |
| - | |
287 |
| - | |
288 |
| - | |
289 |
| - | |
290 |
| - | |
291 |
| - | |
292 |
| - | |
293 |
| - | |
294 |
| - | |
295 |
| - | |
296 |
| - | |
297 |
| - | |
298 |
| - | |
299 |
| - | |
300 |
| - | |
301 |
| - | |
302 |
| - | |
303 |
| - | |
304 |
| - | |
305 |
| - | |
306 |
| - | |
307 |
| - | |
308 |
| - | |
309 |
| - | |
310 |
| - | |
311 |
| - | |
312 |
| - | |
313 |
| - | |
314 |
| - | |
315 |
| - | |
316 |
| - | |
317 |
| - | |
318 |
| - | |
319 |
| - | |
320 |
| - | |
321 |
| - | |
322 |
| - | |
323 |
| - | |
324 |
| - | |
325 |
| - | |
326 |
| - | |
327 |
| - | |
328 |
| - | |
329 |
| - | |
330 |
| - | |
331 |
| - | |
332 |
| - | |
333 |
| - | |
334 |
| - | |
335 |
| - | |
336 |
| - | |
337 |
| - | |
338 |
| - | |
339 |
| - | |
340 |
| - | |
341 |
| - | |
342 |
| - | |
343 |
| - | |
344 |
| - | |
345 |
| - | |
346 |
| - | |
347 |
| - | |
348 | 268 |
| |
349 | 269 |
| |
350 | 270 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| 20 | + | |
20 | 21 |
| |
21 | 22 |
| |
22 | 23 |
| |
| |||
273 | 274 |
| |
274 | 275 |
| |
275 | 276 |
| |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
276 | 289 |
| |
277 | 290 |
| |
278 | 291 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
455 | 455 |
| |
456 | 456 |
| |
457 | 457 |
| |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
458 | 470 |
| |
459 | 471 |
| |
460 | 472 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2298 | 2298 |
| |
2299 | 2299 |
| |
2300 | 2300 |
| |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
2301 | 2313 |
| |
2302 | 2314 |
| |
2303 | 2315 |
| |
|
Lines changed: 37 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| 22 | + | |
22 | 23 |
| |
23 | 24 |
| |
24 | 25 |
| |
| |||
97 | 98 |
| |
98 | 99 |
| |
99 | 100 |
| |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
100 | 113 |
| |
101 | 114 |
| |
102 | 115 |
| |
| |||
287 | 300 |
| |
288 | 301 |
| |
289 | 302 |
| |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
290 | 315 |
| |
291 | 316 |
| |
292 | 317 |
| |
| |||
374 | 399 |
| |
375 | 400 |
| |
376 | 401 |
| |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + |
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
60 |
| - | |
| 60 | + | |
61 | 61 |
| |
62 | 62 |
|
0 commit comments
Comments
(0)