Commit 2720e96
committed
Fix handling of sortKeys field in Tuplesortstate.
Commit 5cefbf5 introduced an
assumption that this field would always be non-NULL when doing a merge
pass, but that's not true. Without this fix, you can crash the server
by building a hash index that is sufficiently large relative to
maintenance_work_mem, or by triggering a large datum sort.
Commit 5ea86e6 changed the comments
for that field to say that it would be set in all cases except for the
hash index case, but that wasn't (and still isn't) true.
The datum-sort failure was spotted by Tomas Vondra; initial analysis
of that failure was by Peter Geoghegan. The remaining issues were
spotted by me during review of the surrounding code, and the patch is
all my fault.1 parent f1fd515 commit 2720e96
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
340 | | - | |
341 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| |||
1246 | 1246 | | |
1247 | 1247 | | |
1248 | 1248 | | |
1249 | | - | |
| 1249 | + | |
1250 | 1250 | | |
1251 | 1251 | | |
1252 | 1252 | | |
| |||
2172 | 2172 | | |
2173 | 2173 | | |
2174 | 2174 | | |
2175 | | - | |
| 2175 | + | |
2176 | 2176 | | |
2177 | 2177 | | |
2178 | 2178 | | |
| |||
0 commit comments