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

Commit7761b9f

Browse files
committed
Use correct datum macros in more tuplesort specialization functions.
Also clarify that ApplySignedSortComparator() is not built on 32-bit machines.Folow-up toc90c165Reviewed-by: David RowleyDiscussion:https://www.postgresql.org/message-id/CAFBsxsFmt4_JUP8XgSJqwaAS9a9s8K8_PvMu%3Dj%3DDfwU%3D8QjNPw%40mail.gmail.com
1 parentd70b95a commit7761b9f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

‎src/include/utils/sortsupport.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ ApplyUnsignedSortComparator(Datum datum1, bool isNull1,
262262
returncompare;
263263
}
264264

265+
#ifSIZEOF_DATUM >=8
265266
staticinlineint
266267
ApplySignedSortComparator(Datumdatum1,boolisNull1,
267268
Datumdatum2,boolisNull2,
@@ -287,19 +288,15 @@ ApplySignedSortComparator(Datum datum1, bool isNull1,
287288
}
288289
else
289290
{
290-
#ifSIZEOF_DATUM==8
291-
compare= (int64)datum1< (int64)datum2 ?-1 :
292-
(int64)datum1> (int64)datum2 ?1 :0;
293-
#else
294-
compare= (int32)datum1< (int32)datum2 ?-1 :
295-
(int32)datum1> (int32)datum2 ?1 :0;
296-
#endif
291+
compare=DatumGetInt64(datum1)<DatumGetInt64(datum2) ?-1 :
292+
DatumGetInt64(datum1)>DatumGetInt64(datum2) ?1 :0;
297293
if (ssup->ssup_reverse)
298294
INVERT_COMPARE_RESULT(compare);
299295
}
300296

301297
returncompare;
302298
}
299+
#endif
303300

304301
staticinlineint
305302
ApplyInt32SortComparator(Datumdatum1,boolisNull1,
@@ -326,8 +323,8 @@ ApplyInt32SortComparator(Datum datum1, bool isNull1,
326323
}
327324
else
328325
{
329-
compare=(int32)datum1< (int32)datum2 ?-1 :
330-
(int32)datum1> (int32)datum2 ?1 :0;
326+
compare=DatumGetInt32(datum1)<DatumGetInt32(datum2) ?-1 :
327+
DatumGetInt32(datum1)>DatumGetInt32(datum2) ?1 :0;
331328
if (ssup->ssup_reverse)
332329
INVERT_COMPARE_RESULT(compare);
333330
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp