citus/src/backend/distributed/utils
Andres Freund 0670ba6376 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:02:36 -07:00
..
citus_clauses.c citus_indent fixups 2016-07-13 11:45:51 -07:00
citus_nodefuncs.c Fix SELECT problem with no target list 2016-04-13 11:08:14 +03:00
citus_outfuncs.c Only reparse queries if the planner flags them for reparsing 2016-07-13 11:45:51 -07:00
citus_read.c Update copyright dates 2016-03-23 17:14:37 -06:00
citus_readfuncs_95.c Only reparse queries if the planner flags them for reparsing 2016-07-13 11:45:51 -07:00
citus_ruleutils.c Support SERIAL/BIGSERIAL non-partition columns 2016-07-28 23:55:40 -06:00
connection_cache.c Quick fix for possible segfault in PurgeConnection 2016-07-29 00:12:56 -06:00
listutils.c Update copyright dates 2016-03-23 17:14:37 -06:00
metadata_cache.c Don't access pg_dist_partition->partkey directly, use heap_getattr(). 2016-07-29 10:02:36 -07:00
multi_resowner.c Update copyright dates 2016-03-23 17:14:37 -06:00
resource_lock.c ADD master_modify_multiple_shards UDF 2016-05-26 17:30:35 +03:00
ruleutils_95.c Always schema-prefix worker queries 2016-07-20 10:42:24 +03:00
shardinterval_utils.c ADD master_modify_multiple_shards UDF 2016-05-26 17:30:35 +03:00