Remove es_result_relation_info from EState.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 14 Oct 2020 08:41:40 +0000 (11:41 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 14 Oct 2020 08:41:40 +0000 (11:41 +0300)
commita04daa97a4339c38e304cd6164d37da540d665a8
treefe77d311bc7aa4ad87db41730a3ba2cb7d1a5313
parent178f2d560dde05b356ab2f586b8bc62514f454aa
Remove es_result_relation_info from EState.

Maintaining 'es_result_relation_info' correctly at all times has become
cumbersome, especially with partitioning where each partition gets its
own result relation info. Having to set and reset it across arbitrary
operations has caused bugs in the past.

This changes all the places that used 'es_result_relation_info', to
receive the currently active ResultRelInfo via function parameters
instead.

Author: Amit Langote
Discussion: https://www.postgresql.org/message-id/CA%2BHiwqGEmiib8FLiHMhKB%2BCH5dRgHSLc5N5wnvc4kym%2BZYpQEQ%40mail.gmail.com
13 files changed:
src/backend/commands/copy.c
src/backend/commands/tablecmds.c
src/backend/executor/execIndexing.c
src/backend/executor/execMain.c
src/backend/executor/execReplication.c
src/backend/executor/execUtils.c
src/backend/executor/nodeModifyTable.c
src/backend/replication/logical/worker.c
src/include/executor/executor.h
src/include/executor/nodeModifyTable.h
src/include/nodes/execnodes.h
src/test/regress/expected/insert.out
src/test/regress/sql/insert.sql