postgresql/src/backend
Etsuro Fujita 5c854e7a2c Disable asynchronous execution if using gating Result nodes.
mark_async_capable_plan(), which is called from create_append_plan() to
determine whether subplans are async-capable, failed to take into
account that the given subplan created from a given subpath might
include a gating Result node if the subpath is a SubqueryScanPath or
ForeignPath, causing a segmentation fault there when the subplan created
from a SubqueryScanPath includes the Result node, or causing
ExecAsyncRequest() to throw an error about an unrecognized node type
when the subplan created from a ForeignPath includes the Result node,
because in the latter case the Result node was unintentionally
considered as async-capable, but we don't currently support executing
Result nodes asynchronously.  Fix by modifying mark_async_capable_plan()
to disable asynchronous execution in such cases.  Also, adjust code in
the ProjectionPath case in mark_async_capable_plan(), for consistency
with other cases, and adjust/improve comments there.

is_async_capable_path() added in commit 27e1f1456, which was rewritten
to mark_async_capable_plan() in a later commit, has the same issue,
causing the error at execution mentioned above, so back-patch to v14
where the aforesaid commit went in.

Per report from Justin Pryzby.

Etsuro Fujita, reviewed by Zhihong Yu and Justin Pryzby.

Discussion: https://postgr.es/m/20220408124338.GK24419%40telsasoft.com
2022-04-28 15:15:00 +09:00
..
access Revert recent changes with durable_rename_excl() 2022-04-28 13:08:16 +09:00
bootstrap pg_upgrade: Preserve relfilenodes and tablespace OIDs. 2022-01-17 13:40:27 -05:00
catalog Rethink method for assigning OIDs to the template0 and postgres DBs. 2022-04-21 16:23:15 -04:00
commands Always pfree strings returned by GetDatabasePath 2022-04-25 10:32:13 +02:00
executor Fix incorrect format placeholders 2022-04-27 09:49:10 +02:00
foreign Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
jit Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
lib dshash: revise sequential scan support. 2022-04-04 14:32:52 -07:00
libpq Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
main Fix collection of typos in the code and the documentation 2022-03-15 11:29:35 +09:00
nodes Handle NULL fields in WRITE_INDEX_ARRAY 2022-04-27 09:15:09 +02:00
optimizer Disable asynchronous execution if using gating Result nodes. 2022-04-28 15:15:00 +09:00
parser Avoid invalid array reference in transformAlterTableStmt(). 2022-04-18 12:16:45 -04:00
partitioning Refactor and cleanup runtime partition prune code a little 2022-04-05 11:46:48 +02:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Ensure that the argument of shmdt(2) is declared "void *". 2022-02-15 17:17:28 -05:00
postmaster Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
regex Call pg_newlocale_from_collation() also with default collation 2022-01-20 09:50:18 +01:00
replication Fix SQL syntax in comment in logical/worker.c 2022-04-28 09:27:32 +07:00
rewrite Fix incautious CTE matching in rewriteSearchAndCycle(). 2022-04-23 12:16:12 -04:00
snowball Update copyright for 2022 2022-01-07 19:04:57 -05:00
statistics Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
storage Revert recent changes with durable_rename_excl() 2022-04-28 13:08:16 +09:00
tcop Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
tsearch Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
utils Fix incorrect format placeholders 2022-04-27 09:49:10 +02:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Server-side gzip compression. 2022-01-24 15:13:18 -05:00
nls.mk Report progress of startup operations that take a long time. 2021-10-25 11:51:57 -04:00