citus/src
Andres Freund aab8e6b324 Don't access pg_dist_partition->partkey directly, use heap_getattr().
Text datums can't be directly accessed via the struct equivalence trick
used to access catalogs. That's because, as an optimization, they're
sometimes aligned to 1 byte ("text"'s alignment), and sometimes to 4
bytes. That depends on it being a short
varlena (cf. VARATT_NOT_PAD_BYTE) or not.

In the case at hand here, partkey became longer than 127 characters -
the boundary for short varlenas (cf. VARATT_CAN_MAKE_SHORT()). Thus it
became 4 byte/int aligned. Which lead to the direct struct access
accessing the wrong data.

The fix is simply to never access partkey that way - to enforce that,
hide partkey ehind the usual ifdef.

Fixes: #674
2016-07-29 10:03:56 -07:00
..
backend Don't access pg_dist_partition->partkey directly, use heap_getattr(). 2016-07-29 10:03:56 -07:00
bin Add deprecation warning to copy_to_distributed_table 2016-05-03 14:08:42 +02:00
include Don't access pg_dist_partition->partkey directly, use heap_getattr(). 2016-07-29 10:03:56 -07:00
test/regress Refactor task tracker cleanup to enable workers receive cleanup jobs 2016-06-17 15:49:38 -06:00