aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/numeric.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-07-13 18:45:30 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-07-13 18:45:30 -0400
commit28a1ae5342fe39b7c4057d3f872cb6057f5f33bf (patch)
tree60967c3362c5acfc3fa0d2144006e2ebf45aad6f /src/backend/utils/adt/numeric.c
parent333224c99ed107a4e73dc7768879c2a37c6f99ab (diff)
downloadpostgresql-28a1ae5342fe39b7c4057d3f872cb6057f5f33bf.tar.gz
postgresql-28a1ae5342fe39b7c4057d3f872cb6057f5f33bf.zip
Fix crash in contrib/ltree's lca() function for empty input array.
lca_inner() wasn't prepared for the possibility of getting no inputs. Fix that, and make some cosmetic improvements to the code while at it. Also, I thought the documentation of this function as returning the "longest common prefix" of the paths was entirely misleading; it really returns a path one shorter than the longest common prefix, for the typical definition of "prefix". Don't use that term in the docs, and adjust the examples to clarify what really happens. This has been broken since its beginning, so back-patch to all supported branches. Per report from Hailong Li. Thanks to Pierre Ducroquet for diagnosing and for the initial patch, though I whacked it around some and added test cases. Discussion: https://postgr.es/m/5b0d8e4f-f2a3-1305-d612-e00e35a7be66@qunar.com
Diffstat (limited to 'src/backend/utils/adt/numeric.c')
0 files changed, 0 insertions, 0 deletions