Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit53abb1e

Browse files
committed
Fix newly introduced issue in EXPLAIN for Materialize nodes
The code added in1eff827 was lacking a check to see if the tuplestorehad been created. In nodeMaterial.c this is done by ExecMaterial() ratherthan by ExecInitMaterial(), so the tuplestore won't be created unlessthe node has been executed at least once, as demonstrated by Alexanderin his report.Here we skip showing any of the new EXPLAIN ANALYZE information when theMaterialize node has not been executed.Reported-by: Alexander LakhinDiscussion:https://postgr.es/m/fe7fc8fb-86e5-ecb0-3cb2-dd2c9a6c482f@gmail.com
1 parent1850184 commit53abb1e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

‎src/backend/commands/explain.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3333,14 +3333,17 @@ show_hash_info(HashState *hashstate, ExplainState *es)
33333333
staticvoid
33343334
show_material_info(MaterialState*mstate,ExplainState*es)
33353335
{
3336-
Tuplestorestate*tupstore;
3336+
Tuplestorestate*tupstore=mstate->tuplestorestate;
33373337
constchar*storageType;
33383338
int64spaceUsedKB;
33393339

3340-
if (!es->analyze)
3340+
/*
3341+
* Nothing to show if ANALYZE option wasn't used or if execution didn't
3342+
* get as far as creating the tuplestore.
3343+
*/
3344+
if (!es->analyze||tupstore==NULL)
33413345
return;
33423346

3343-
tupstore=mstate->tuplestorestate;
33443347
storageType=tuplestore_storage_type_name(tupstore);
33453348
spaceUsedKB=BYTES_TO_KILOBYTES(tuplestore_space_used(tupstore));
33463349

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp