pgsql: Fix possible sorting error when aborting use of abbreviated keys

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix possible sorting error when aborting use of abbreviated keys
Date: 2016-08-22 19:33:47
Message-ID: E1bbuyh-0002MY-Fw@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/da9659f87c868ae638ea34654737f9ef0409211f

Modified Files
--------------
src/backend/utils/sort/tuplesort.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2016-08-22 21:21:31 pgsql: doc: fix typo in recent patch
Previous Message Robert Haas 2016-08-22 16:00:45 pgsql: Improve header comment for LockHasWaitersRelation.