pgsql: Add a regression test case to improve code coverage for tuplesor

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add a regression test case to improve code coverage for tuplesor
Date: 2016-07-13 19:24:01
Message-ID: E1bNPlJ-0006B6-QO@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add a regression test case to improve code coverage for tuplesort.

Test the external-sort code path in CLUSTER for two different scenarios:
multiple-pass external sorting, and the best case for replacement
selection, where only one run is produced, so that no merge is required.
This test would have caught the bug fixed in commit 1b0fc8507, at
least when run with valgrind enabled.

In passing, add a short-circuit test in plan_cluster_use_sort() to make
dead certain that it selects sorting when enable_indexscan is off. As
things stand, that would happen anyway, but it seems like good future
proofing for this test.

Peter Geoghegan

Discussion: <CAM3SWZSgxehDkDMq1FdiW2A0Dxc79wH0hz1x-TnGy=1BXEL+nw(at)mail(dot)gmail(dot)com>

Branch
------
master

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

Modified Files
--------------
src/backend/optimizer/plan/planner.c | 4 ++++
src/test/regress/expected/cluster.out | 36 +++++++++++++++++++++++++++++++++++
src/test/regress/sql/cluster.sql | 34 +++++++++++++++++++++++++++++++++
3 files changed, 74 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-07-13 19:36:38 pgsql: Minor test adjustment.
Previous Message Andres Freund 2016-07-13 17:48:38 Re: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <