pgsql: Fix handling of sortKeys field in Tuplesortstate. - Mailing list pgsql-committers

From Robert Haas
Subject pgsql: Fix handling of sortKeys field in Tuplesortstate.
Date
Msg-id E1YUymn-0007mD-Hw@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix handling of sortKeys field in Tuplesortstate.

Commit 5cefbf5a6c4466ac6b1cc2a4316b4eba9108c802 introduced an
assumption that this field would always be non-NULL when doing a merge
pass, but that's not true.  Without this fix, you can crash the server
by building a hash index that is sufficiently large relative to
maintenance_work_mem, or by triggering a large datum sort.

Commit 5ea86e6e65dd2da3e9a3464484985d48328e7fe3 changed the comments
for that field to say that it would be set in all cases except for the
hash index case, but that wasn't (and still isn't) true.

The datum-sort failure was spotted by Tomas Vondra; initial analysis
of that failure was by Peter Geoghegan.  The remaining issues were
spotted by me during review of the surrounding code, and the patch is
all my fault.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/2720e96a9bd58b2af177c714c0c5402773e1cf30

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


pgsql-committers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: pgsql: Move WAL-related definitions from dbcommands.h to separate heade
Next
From: Michael Meskes
Date:
Subject: pgsql: Ignore leftover artifacts from ecpg testsuite runs on Windows.