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

Commit9fe802c

Browse files
committed
Fix brown-paper-bag bug in commit0a459ce.
RANGE_OFFSET comparisons need to examine the first ORDER BY column,which isn't necessarily the first column in the incoming tuples.No idea how this slipped through initial testing.Per bug #15082 from Zhou Digoal.Discussion:https://postgr.es/m/151939899974.1461.9411971793110285476@wrigleys.postgresql.org
1 parent8af87f4 commit9fe802c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎src/backend/executor/nodeWindowAgg.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,6 +1559,7 @@ update_frameheadpos(WindowAggState *winstate)
15591559
* reach end of partition, we will leave frameheadpos = end+1 and
15601560
* framehead_slot empty.
15611561
*/
1562+
intsortCol=node->ordColIdx[0];
15621563
boolsub,
15631564
less;
15641565

@@ -1593,9 +1594,9 @@ update_frameheadpos(WindowAggState *winstate)
15931594
boolheadisnull,
15941595
currisnull;
15951596

1596-
headval=slot_getattr(winstate->framehead_slot,1,
1597+
headval=slot_getattr(winstate->framehead_slot,sortCol,
15971598
&headisnull);
1598-
currval=slot_getattr(winstate->ss.ss_ScanTupleSlot,1,
1599+
currval=slot_getattr(winstate->ss.ss_ScanTupleSlot,sortCol,
15991600
&currisnull);
16001601
if (headisnull||currisnull)
16011602
{
@@ -1809,6 +1810,7 @@ update_frametailpos(WindowAggState *winstate)
18091810
* necessary. Note that if we reach end of partition, we will
18101811
* leave frametailpos = end+1 and frametail_slot empty.
18111812
*/
1813+
intsortCol=node->ordColIdx[0];
18121814
boolsub,
18131815
less;
18141816

@@ -1843,9 +1845,9 @@ update_frametailpos(WindowAggState *winstate)
18431845
booltailisnull,
18441846
currisnull;
18451847

1846-
tailval=slot_getattr(winstate->frametail_slot,1,
1848+
tailval=slot_getattr(winstate->frametail_slot,sortCol,
18471849
&tailisnull);
1848-
currval=slot_getattr(winstate->ss.ss_ScanTupleSlot,1,
1850+
currval=slot_getattr(winstate->ss.ss_ScanTupleSlot,sortCol,
18491851
&currisnull);
18501852
if (tailisnull||currisnull)
18511853
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp