]> granicus.if.org Git - postgresql/commit
Fix possible sorting error when aborting use of abbreviated keys.
authorRobert Haas <rhaas@postgresql.org>
Mon, 22 Aug 2016 19:22:11 +0000 (15:22 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 22 Aug 2016 19:30:37 +0000 (15:30 -0400)
commitda9659f87c868ae638ea34654737f9ef0409211f
tree1afc026696c53c649fade2078f1c752e08b15395
parentac3aac3292d6e958bb8235120ba6a12159a29afe
Fix possible sorting error when aborting use of abbreviated keys.

Due to an error in the abbreviated key abort logic, the most recently
processed SortTuple could be incorrectly marked NULL, resulting in an
incorrect final sort order.

In the worst case, this could result in a corrupt btree index, which
would need to be rebuild using REINDEX.  However, abbrevation doesn't
abort very often, not all data types use it, and only one tuple would
end up in the wrong place, so the practical impact of this mistake may
be somewhat limited.

Report and patch by Peter Geoghegan.
src/backend/utils/sort/tuplesort.c