]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix overly-strict assertions in spgtextproc.c.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 2 Jan 2016 21:24:50 +0000 (16:24 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 2 Jan 2016 21:25:03 +0000 (16:25 -0500)
commit1cd38408ba4e851eeccff6ffbba049a7a916c4e1
treec931d1d43bbd5799e52484a0a29f8a347acee47e
parent88ee25658536b93ea94cf90f176a0c3f2febf6e0
Fix overly-strict assertions in spgtextproc.c.

spg_text_inner_consistent is capable of reconstructing an empty string
to pass down to the next index level; this happens if we have an empty
string coming in, no prefix, and a dummy node label.  (In practice, what
is needed to trigger that is insertion of a whole bunch of empty-string
values.)  Then, we will arrive at the next level with in->level == 0
and a non-NULL (but zero length) in->reconstructedValue, which is valid
but the Assert tests weren't expecting it.

Per report from Andreas Seltenreich.  This has no impact in non-Assert
builds, so should not be a problem in production, but back-patch to
all affected branches anyway.

In passing, remove a couple of useless variable initializations and
shorten the code by not duplicating DatumGetPointer() calls.
src/backend/access/spgist/spgtextproc.c