提交 8caf6132 编写于 作者: H Heikki Linnakangas

In the final emptying phase of the new GiST buffering build, set the

queuedForEmptying flag correctly on buffer when adding it to the queue.
Also, don't add buffer to the queue if it's there already. These were
harmless oversights; failing to set the flag just means that a buffer might
get added to the queue twice if more tuples are added to it (although that
can't actually happen at this point because all the upper buffers have
already been emptied), and having the same buffer twice in the emptying
queue is harmless. But better be tidy.
上级 b0025bd9
......@@ -964,10 +964,14 @@ gistEmptyAllBuffers(GISTBuildState *buildstate)
* Add this buffer to the emptying queue, and proceed to empty
* the queue.
*/
MemoryContextSwitchTo(gfbb->context);
gfbb->bufferEmptyingQueue =
lcons(nodeBuffer, gfbb->bufferEmptyingQueue);
MemoryContextSwitchTo(buildstate->tmpCtx);
if (!nodeBuffer->queuedForEmptying)
{
MemoryContextSwitchTo(gfbb->context);
nodeBuffer->queuedForEmptying = true;
gfbb->bufferEmptyingQueue =
lcons(nodeBuffer, gfbb->bufferEmptyingQueue);
MemoryContextSwitchTo(buildstate->tmpCtx);
}
gistProcessEmptyingQueue(buildstate);
}
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册