]> granicus.if.org Git - postgresql/commit
Fix freeing old values in index_store_float8_orderby_distances()
authorAlexander Korotkov <akorotkov@postgresql.org>
Thu, 19 Sep 2019 22:10:56 +0000 (01:10 +0300)
committerAlexander Korotkov <akorotkov@postgresql.org>
Thu, 19 Sep 2019 22:20:07 +0000 (01:20 +0300)
commit8c58e480d9ddecbe94badc737d60c866974144b5
tree44b7e7b6c1e80af50b76be4e15e6c726e9929048
parent31cbd760578fc0aeb87db11422c32afaf5de129b
Fix freeing old values in index_store_float8_orderby_distances()

6cae9d2c10 has added an error in freeing old values in
index_store_float8_orderby_distances() function.  It looks for old value in
scan->xs_orderbynulls[i] after setting a new value there.
This commit fixes that.  Also it removes short-circuit in handling
distances == NULL situation.  Now distances == NULL will be treated the same
way as array with all null distances.  That is, previous values will be freed
if any.

Reported-by: Tom Lane, Nikita Glukhov
Discussion: https://postgr.es/m/CAPpHfdu2wcoAVAm3Ek66rP%3Duo_C-D84%2B%2Buf1VEcbyi_caBXWCA%40mail.gmail.com
Discussion: https://postgr.es/m/426580d3-a668-b9d1-7b8e-f74d1a6524e0%40postgrespro.ru
Backpatch-through: 12
src/backend/access/index/indexam.c