Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9bc9f72

Browse files
author
Amit Kapila
committed
MAXALIGN the target address where we store flattened value.
The API (EOH_flatten_into) that flattens the expanded value representationexpects the target address to be maxaligned. All it's usage adhere to thatprinciple except when serializing datums for parallel query. Fix thatusage.Diagnosed-by: Tom LaneAuthor: Tom Lane and Amit KapilaBackpatch-through: 9.6Discussion:https://postgr.es/m/11629.1536550032@sss.pgh.pa.us
1 parenta33245a commit9bc9f72

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

‎src/backend/utils/adt/datum.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,19 @@ datumSerialize(Datum value, bool isnull, bool typByVal, int typLen,
338338
}
339339
elseif (eoh)
340340
{
341-
EOH_flatten_into(eoh, (void*)*start_address,header);
341+
char*tmp;
342+
343+
/*
344+
* EOH_flatten_into expects the target address to be maxaligned,
345+
* so we can't store directly to *start_address.
346+
*/
347+
tmp= (char*)palloc(header);
348+
EOH_flatten_into(eoh, (void*)tmp,header);
349+
memcpy(*start_address,tmp,header);
342350
*start_address+=header;
351+
352+
/* be tidy. */
353+
pfree(tmp);
343354
}
344355
else
345356
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp