diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-07-28 02:08:52 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-07-28 02:08:52 -0400 |
commit | e1a93dd6ae114669669e3a77167dc3d3bd91e035 (patch) | |
tree | 5cd606b79cab0b198fd422a8740163a2b843bfed /src/backend/executor/tqueue.c | |
parent | 69995c3b3fd64361bb4d3938315f3e88ccc01e53 (diff) | |
download | postgresql-e1a93dd6ae114669669e3a77167dc3d3bd91e035.tar.gz postgresql-e1a93dd6ae114669669e3a77167dc3d3bd91e035.zip |
tqueue.c's record-typmod hashtables need the HASH_BLOBS option.
The keys are integers, not strings. The code accidentally worked on
little-endian machines, at least up to 256 distinct record types within
a session, but failed utterly on big-endian. This was unexpectedly
exposed by a test case added by commit 4452000f3, which apparently is the
only parallelizable query in the regression suite that uses more than one
anonymous record type. Fortunately, buildfarm member mandrill is
big-endian and is running with force_parallel_mode on, so it failed.
Diffstat (limited to 'src/backend/executor/tqueue.c')
-rw-r--r-- | src/backend/executor/tqueue.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/executor/tqueue.c b/src/backend/executor/tqueue.c index a729372c740..d29fd2afde4 100644 --- a/src/backend/executor/tqueue.c +++ b/src/backend/executor/tqueue.c @@ -402,7 +402,8 @@ tqueueSendTypmodInfo(TQueueDestReceiver *tqueue, int typmod, ctl.entrysize = sizeof(int); ctl.hcxt = TopMemoryContext; tqueue->recordhtab = hash_create("tqueue record hashtable", - 100, &ctl, HASH_ELEM | HASH_CONTEXT); + 100, &ctl, + HASH_ELEM | HASH_BLOBS | HASH_CONTEXT); } /* Have we already seen this record type? If not, must report it. */ @@ -877,7 +878,8 @@ TupleQueueHandleControlMessage(TupleQueueReader *reader, Size nbytes, ctl.entrysize = sizeof(RecordTypemodMap); ctl.hcxt = CurTransactionContext; reader->typmodmap = hash_create("typmodmap hashtable", - 100, &ctl, HASH_ELEM | HASH_CONTEXT); + 100, &ctl, + HASH_ELEM | HASH_BLOBS | HASH_CONTEXT); } /* Create map entry. */ |