pgsql: Fix handling of REWIND/MARK/BACKWARD in incremental sort

From: Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix handling of REWIND/MARK/BACKWARD in incremental sort
Date: 2020-05-09 17:42:03
Message-ID: E1jXTUB-0001VM-Jp@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix handling of REWIND/MARK/BACKWARD in incremental sort

The executor flags were not handled entirely correctly, although the
bugs were mostly harmless and it was mostly comment inaccuracy. We don't
need to strip any of the flags for child nodes.

Incremental sort does not support backward scans of mark/restore, so
MARK/BACKWARDS flags should not be possible. So we simply ensure this
using an assert, and we don't bother removing them when initializing
the child node.

With REWIND it's a bit less clear - incremental sort does not support
REWIND, but there is no way to signal this - it's legal to just ignore
the flag. We however continue passing the flag to child nodes, because
they might be useful to leverage that.

Reported-by: Michael Paquier
Author: James Coleman
Reviewed-by: Tomas Vondra
Discussion: https://postgr.es/m/20200414065336.GI1492@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c4427226483c78618ba45eff34917400a77718a5

Modified Files
--------------
src/backend/executor/nodeIncrementalSort.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-05-09 20:28:31 pgsql: Fix findoidjoins to recognize oidvector columns.
Previous Message Tom Lane 2020-05-09 17:05:15 pgsql: Update oidjoins regression test for v13.