git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 54eff53) | patch
Ensure proper alignment of tuples in HashMemoryChunkData buffers.
Wed, 3 Jan 2018 02:23:02 +0000 (21:23 -0500)
Wed, 3 Jan 2018 02:23:06 +0000 (21:23 -0500)
commit 5dc692f78d3bee1e86d095a9e8d9242b44f78b01
Ensure proper alignment of tuples in HashMemoryChunkData buffers.

The previous coding relied (without any documentation) on the data[]
member of HashMemoryChunkData being at a MAXALIGN'ed offset. If it
was not, the tuples would not be maxaligned either, leading to failures
on alignment-picky machines. While there seems to be no live bug on any
platform we support, this is clearly pretty fragile: any addition to or
rearrangement of the fields in HashMemoryChunkData could break it.
Let's remove the hazard by getting rid of the data[] member and instead
using pointer arithmetic with an explicitly maxalign'ed offset.

Discussion: https://postgr.es/m/14483.1514938129@sss.pgh.pa.us
src/backend/executor/nodeHash.c diff | blob | blame | history
src/include/executor/hashjoin.h diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /