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

Commitda9659f

Browse files
committed
Fix possible sorting error when aborting use of abbreviated keys.
Due to an error in the abbreviated key abort logic, the most recentlyprocessed SortTuple could be incorrectly marked NULL, resulting in anincorrect final sort order.In the worst case, this could result in a corrupt btree index, whichwould need to be rebuild using REINDEX. However, abbrevation doesn'tabort very often, not all data types use it, and only one tuple wouldend up in the wrong place, so the practical impact of this mistake maybe somewhat limited.Report and patch by Peter Geoghegan.
1 parentac3aac3 commitda9659f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/backend/utils/sort/tuplesort.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ tuplesort_putindextuplevalues(Tuplesortstate *state, Relation rel,
13141314
mtup->datum1=index_getattr(tuple,
13151315
1,
13161316
RelationGetDescr(state->indexRel),
1317-
&stup.isnull1);
1317+
&mtup->isnull1);
13181318
}
13191319
}
13201320

@@ -3440,7 +3440,7 @@ copytup_cluster(Tuplesortstate *state, SortTuple *stup, void *tup)
34403440
mtup->datum1=heap_getattr(tuple,
34413441
state->indexInfo->ii_KeyAttrNumbers[0],
34423442
state->tupDesc,
3443-
&stup->isnull1);
3443+
&mtup->isnull1);
34443444
}
34453445
}
34463446
}
@@ -3744,7 +3744,7 @@ copytup_index(Tuplesortstate *state, SortTuple *stup, void *tup)
37443744
mtup->datum1=index_getattr(tuple,
37453745
1,
37463746
RelationGetDescr(state->indexRel),
3747-
&stup->isnull1);
3747+
&mtup->isnull1);
37483748
}
37493749
}
37503750
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp