Fix newly introduced issue in EXPLAIN for Materialize nodes
authorDavid Rowley <[email protected]>
Fri, 5 Jul 2024 04:56:16 +0000 (16:56 +1200)
committerDavid Rowley <[email protected]>
Fri, 5 Jul 2024 04:56:16 +0000 (16:56 +1200)
commit53abb1e0ebc38818f31f2ddb15a06feba8e19e6c
tree89542734dc1d25fee5ef59dc5487c484e12198e4
parent18501841bcb4e693b9f1e9da2b2fb524c78940d8
Fix newly introduced issue in EXPLAIN for Materialize nodes

The code added in 1eff8279d was lacking a check to see if the tuplestore
had been created.  In nodeMaterial.c this is done by ExecMaterial() rather
than by ExecInitMaterial(), so the tuplestore won't be created unless
the node has been executed at least once, as demonstrated by Alexander
in his report.

Here we skip showing any of the new EXPLAIN ANALYZE information when the
Materialize node has not been executed.

Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/fe7fc8fb-86e5-ecb0-3cb2-dd2c9a6c482f@gmail.com
src/backend/commands/explain.c