Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e1a93dd

Browse files
committed
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 4452000, 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.
1 parent 69995c3 commit e1a93dd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/executor/tqueue.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,8 @@ tqueueSendTypmodInfo(TQueueDestReceiver *tqueue, int typmod,
402402
ctl.entrysize = sizeof(int);
403403
ctl.hcxt = TopMemoryContext;
404404
tqueue->recordhtab = hash_create("tqueue record hashtable",
405-
100, &ctl, HASH_ELEM | HASH_CONTEXT);
405+
100, &ctl,
406+
HASH_ELEM | HASH_BLOBS | HASH_CONTEXT);
406407
}
407408

408409
/* Have we already seen this record type? If not, must report it. */
@@ -877,7 +878,8 @@ TupleQueueHandleControlMessage(TupleQueueReader *reader, Size nbytes,
877878
ctl.entrysize = sizeof(RecordTypemodMap);
878879
ctl.hcxt = CurTransactionContext;
879880
reader->typmodmap = hash_create("typmodmap hashtable",
880-
100, &ctl, HASH_ELEM | HASH_CONTEXT);
881+
100, &ctl,
882+
HASH_ELEM | HASH_BLOBS | HASH_CONTEXT);
881883
}
882884

883885
/* Create map entry. */

0 commit comments

Comments
 (0)