postgresql/src
Tom Lane 93328b2dfb Fix infinite loop when splitting inner tuples in SPGiST text indexes.
Previously, the code used a node label of zero both for strings that
contain no bytes beyond the inner tuple's prefix, and for cases where an
"allTheSame" inner tuple has to be split to allow a string with a different
next byte to be inserted into it.  Failing to distinguish these cases meant
that if a string ending with the current prefix needed to be inserted into
an allTheSame tuple, we got into an infinite loop, because after splitting
the tuple we'd descend into the child allTheSame tuple and then find we
need to split again.

To fix, instead use -1 and -2 as the node labels for these two cases.
This requires widening the node label type from "char" to int2, but
fortunately SPGiST stores all pass-by-value node label types in their
Datum representation, which means that this change is transparently upward
compatible so far as the on-disk representation goes.  We continue to
recognize zero as a dummy node label for reading purposes, but will not
attempt to push new index entries down into such a label, so that the loop
won't occur even when dealing with an existing index.

Per report from Teodor Sigaev.  Back-patch to 9.2 where the faulty
code was introduced.
2014-06-09 16:30:46 -04:00
..
backend Fix infinite loop when splitting inner tuples in SPGiST text indexes. 2014-06-09 16:30:46 -04:00
bin Fix unportable setvbuf() usage in initdb. 2014-05-15 15:58:01 -04:00
include Fix unportable setvbuf() usage in initdb. 2014-05-15 15:58:01 -04:00
interfaces Revert "Fix bogus %name-prefix option syntax in all our Bison files." 2014-05-28 19:29:05 -04:00
makefiles Don't use deprecated dllwrap on Cygwin. 2014-02-01 16:13:46 -05:00
pl Make plpython_unicode regression test work in more database encodings. 2014-06-03 12:02:18 -04:00
port Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
template Remove BSD/OS (BSDi) port. There are no known users upgrading to 2012-05-03 10:58:44 -04:00
test Fix breakages of hot standby regression test. 2014-06-06 18:48:09 +09:00
timezone Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
tools Ignore config.pl and buildenv.pl in src/tools/msvc. 2014-05-12 14:24:33 -04:00
tutorial Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Revert "Backpatch pgxs vpath build and installation fixes (v2)" 2013-10-07 22:37:26 -04:00
Makefile.shlib fix whitespace 2014-02-01 16:30:18 -05:00
nls-global.mk Lots of doc corrections. 2012-04-23 22:43:09 -04:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00