postgresql/src/backend/access
Heikki Linnakangas 6aa2bdf6a0 Initialize the entryRes array between each call to triConsistent.
The shimTriConstistentFn, which calls the opclass's consistent function with
all combinations of TRUE/FALSE for any MAYBE argument, modifies the entryRes
array passed by the caller. Change startScanKey to re-initialize it between
each call to accommodate that.

It's actually a bad habit by shimTriConsistentFn to modify its argument. But
the only caller that doesn't already re-initialize the entryRes array was
startScanKey, and it's easy for startScanKey to do so. Add a comment to
shimTriConsistentFn about that.

Note: this does not give a free pass to opclass-provided consistent
functions to modify the entryRes argument; shimTriConsistent assumes that
they don't, even though it does it itself.

While at it, refactor startScanKey to allocate the requiredEntries and
additionalEntries after it knows exactly how large they need to be. Saves a
little bit of memory, and looks nicer anyway.

Per complaint by Tom Lane, buildfarm and the pg_trgm regression test.
2014-02-07 18:53:31 +02:00
..
common Revert C comment change in slot_attisnull() 2014-01-28 12:28:14 -05:00
gin Initialize the entryRes array between each call to triConsistent. 2014-02-07 18:53:31 +02:00
gist Update copyright for 2014 2014-01-07 16:05:30 -05:00
hash Allow use of "z" flag in our printf calls, and use it where appropriate. 2014-01-23 17:18:33 -05:00
heap Allow use of "z" flag in our printf calls, and use it where appropriate. 2014-01-23 17:18:33 -05:00
index Update copyright for 2014 2014-01-07 16:05:30 -05:00
nbtree Remove unnecessary relcache flushes after changing btree metapages. 2014-02-05 13:43:46 -05:00
rmgrdesc Compress GIN posting lists, for smaller index size. 2014-01-22 19:20:58 +02:00
spgist Allow use of "z" flag in our printf calls, and use it where appropriate. 2014-01-23 17:18:33 -05:00
transam Add primary_slotname to recovery.conf.sample. 2014-02-03 00:41:50 +09:00
Makefile Split out rmgr rm_desc functions into their own files 2012-11-28 13:01:15 -03:00