forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfa5185b
committed
Harden Memoization code against broken data types
Bug #17512 highlighted that a suitably broken data type could cause thebackend to crash if either the hash function or equality function were insomeway non-deterministic based on their input values. Such a data typecould cause a crash of the backend due to some code which assumes thatwe'll always find a hash table entry corresponding to an item in theMemoize LRU list.Here we remove the assumption that we'll always find the entrycorresponding to the given LRU list item and add run-time checks to verifywe have found the given item in the cache.This is not a fix for bug #17512, but it will turn the crash reported bythat bug report into an internal ERROR.Reported-by: Ales ZelenyReviewed-by: Tom LaneDiscussion:https://postgr.es/m/CAApHDvpxFSTwvoYWT7kmFVSZ9zLAeHb=S9vrz=RExMgSkQNWqw@mail.gmail.comBackpatch-through: 14, where Memoize was added.1 parentbf4717b commitfa5185b
1 file changed
+7
-3
lines changedLines changed: 7 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
446 | 446 |
| |
447 | 447 |
| |
448 | 448 |
| |
449 |
| - | |
450 |
| - | |
451 |
| - | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
452 | 456 |
| |
453 | 457 |
| |
454 | 458 |
| |
|
0 commit comments
Comments
(0)