Re: Tuple sort is broken. It crashes on simple test.

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Geoghegan <pg@heroku.com>
Cc: Michael Paquier <michael.paquier@gmail.com>, Mithun Cy <mithun.cy@enterprisedb.com>, pgsql-hackers <pgsql-hackers@postgresql.org>, Robert Haas <robertmhaas@gmail.com>, Heikki Linnakangas <hlinnaka@iki.fi>
Date: 2017-01-16T18:54:20Z
Lists: pgsql-hackers
Peter Geoghegan <pg@heroku.com> writes:
> The problem was that one particular call to the macro
> RELEASE_SLAB_SLOT() happened to lack a test-for-NULL-argument needed
> by pass-by-value datum cases. The other two RELEASE_SLAB_SLOT() calls
> already have such a check.

> Attached patch fixes the bug.

Pushed, thanks.

			regards, tom lane


Commits

  1. Fix NULL pointer dereference in tuplesort.c.

  2. Change the way pre-reading in external sort's merge phase works.