GitHub PushEvent at 2014-06-09 20:45:08
Repository: postgres
Actor: postgres-mirror
Payload: {"shas":[["717c116f1dd995921787243e5c58f49877af6ca0","ffeaa947aef224da9ba99b6a18bdd74288df0e3e@sss.pgh.pa.us","Fix infinite loop when splitting inner tuples in SPGiST text indexes.\n\nPreviously, the code used a node label of zero both for strings that\ncontain no bytes beyond the inner tuple's prefix, and for cases where an\n\"allTheSame\" inner tuple has to be split to allow a string with a different\nnext byte to be inserted into it.  Failing to distinguish these cases meant\nthat if a string ending with the current prefix needed to be inserted into\nan allTheSame tuple, we got into an infinite loop, because after splitting\nthe tuple we'd descend into the child allTheSame tuple and then find we\nneed to split again.\n\nTo fix, instead use -1 and -2 as the node labels for these two cases.\nThis requires widening the node label type from \"char\" to int2, but\nfortunately SPGiST stores all pass-by-value node label types in their\nDatum representation, which means that this change is transparently upward\ncompatible so far as the on-disk representation goes.  We continue to\nrecognize zero as a dummy node label for reading purposes, but will not\nattempt to push new index entries down into such a label, so that the loop\nwon't occur even when dealing with an existing index.\n\nPer report from Teodor Sigaev.  Back-patch to 9.2 where the faulty\ncode was introduced.","Tom Lane",true]],"size":1,"ref":"refs/heads/REL9_3_STABLE","head":"717c116f1dd995921787243e5c58f49877af6ca0"}