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

Commitf5af065

Browse files
david-rowleypull[bot]
authored andcommitted
Fix pfree issue in presorted DISTINCT aggregate code
The logic in this area was recently changed in7da5159, however, in thatcommit, I neglected to consider that the conditions in which we shouldpfree the old Datum needed to be updated after that change. This couldresult in trying to pfree a NULL value, as was demonstrated by AlexanderLakhin.Reported-by: Alexander LakhinDiscussion:https://postgr.es/m/4103db46-d888-6d1d-e88d-87c21ed99472@gmail.com
1 parentb0ef852 commitf5af065

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/executor/execExprInterp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4254,7 +4254,8 @@ ExecEvalPreOrderedDistinctSingle(AggState *aggstate, AggStatePerTrans pertrans)
42544254
pertrans->aggCollation,
42554255
pertrans->lastdatum,value))))
42564256
{
4257-
if (pertrans->haslast&& !pertrans->inputtypeByVal)
4257+
if (pertrans->haslast&& !pertrans->inputtypeByVal&&
4258+
!pertrans->lastisnull)
42584259
pfree(DatumGetPointer(pertrans->lastdatum));
42594260

42604261
pertrans->haslast= true;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp