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

Commit48b9ca0

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 parentc381326 commit48b9ca0

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
@@ -1443,7 +1443,7 @@ tuplesort_putindextuplevalues(Tuplesortstate *state, Relation rel,
14431443
mtup->datum1=index_getattr(tuple,
14441444
1,
14451445
RelationGetDescr(state->indexRel),
1446-
&stup.isnull1);
1446+
&mtup->isnull1);
14471447
}
14481448
}
14491449

@@ -4271,7 +4271,7 @@ copytup_cluster(Tuplesortstate *state, SortTuple *stup, void *tup)
42714271
mtup->datum1=heap_getattr(tuple,
42724272
state->indexInfo->ii_KeyAttrNumbers[0],
42734273
state->tupDesc,
4274-
&stup->isnull1);
4274+
&mtup->isnull1);
42754275
}
42764276
}
42774277
}
@@ -4588,7 +4588,7 @@ copytup_index(Tuplesortstate *state, SortTuple *stup, void *tup)
45884588
mtup->datum1=index_getattr(tuple,
45894589
1,
45904590
RelationGetDescr(state->indexRel),
4591-
&stup->isnull1);
4591+
&mtup->isnull1);
45924592
}
45934593
}
45944594
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp