提交 894de029 编写于 作者: H Heikki Linnakangas

Fix Material squelching.

If a Material node is used to shield an underlying Motion node from
rescans, we mustn't eagerly-free it when it's squelched. Also, when a
such a Material node is squelched, don't squelch the underlying node,
because we might need to read more tuples from it later.
Reviewed-by: NPengzhou Tang <ptang@pivotal.io>
上级 55795787
......@@ -646,6 +646,18 @@ ExecEagerFreeMaterial(MaterialState *node)
void
ExecSquelchMaterial(MaterialState *node)
{
ExecEagerFreeMaterial(node);
ExecSquelchNode(outerPlanState(node));
/*
* If this Material is shielding the underlying nodes from rescanning (for
* example, if there is a Motion node below), then keep the tuplestore.
* Also, don't recurse to the subtree in that case, because we might need
* to read more tuples from it after a ReScan. Most likely we have already
* read all the tuples from the underlying node in that case, but it's
* possible that ExecMaterial hasn't been called even once yet, and we
* haven't created the tuplestore yet.
*/
if (!node->delayEagerFree)
{
ExecEagerFreeMaterial(node);
ExecSquelchNode(outerPlanState(node));
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册