Commit 255efa24 authored by Kevin Grittner's avatar Kevin Grittner

Fix the RTE_NAMEDTUPLESTORE case in get_rte_attribute_is_dropped().

Problems pointed out by Andres Freund and Thomas Munro.
parent fa117ee4
...@@ -2891,12 +2891,12 @@ get_rte_attribute_is_dropped(RangeTblEntry *rte, AttrNumber attnum) ...@@ -2891,12 +2891,12 @@ get_rte_attribute_is_dropped(RangeTblEntry *rte, AttrNumber attnum)
Assert(rte->enrname); Assert(rte->enrname);
/* /*
* We checked when we loaded ctecoltypes for the tuplestore * We checked when we loaded coltypes for the tuplestore that
* that InvalidOid was only used for dropped columns, so it is * InvalidOid was only used for dropped columns, so it is safe
* safe to count on that here. * to count on that here.
*/ */
result = result =
(list_nth(rte->coltypes, attnum - 1) != InvalidOid); ((list_nth_oid(rte->coltypes, attnum - 1) == InvalidOid));
} }
break; break;
case RTE_JOIN: case RTE_JOIN:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment