提交 b1531912 编写于 作者: D Daniel Gustafsson

Fix tests for MirroredBufferPool_Truncate() invocation

MirroredBufferedPool_Truncate() returns a boolean so testing for
(!returnvalue < 0) will always return false and not what we expect
it to test.

Github user fengttt.
上级 28b12671
......@@ -1740,7 +1740,7 @@ mdtruncate(SMgrRelation reln, BlockNumber nblocks, bool isTemp, bool allowNotFou
*/
BlockNumber lastsegblocks = nblocks - priorblocks;
if (!MirroredBufferPool_Truncate(&v->mdmir_open, lastsegblocks * BLCKSZ) < 0)
if (!MirroredBufferPool_Truncate(&v->mdmir_open, lastsegblocks * BLCKSZ))
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not truncate relation %u/%u/%u to %u blocks: %m",
......@@ -1764,7 +1764,7 @@ mdtruncate(SMgrRelation reln, BlockNumber nblocks, bool isTemp, bool allowNotFou
priorblocks += RELSEG_SIZE;
}
#else
if (!MirroredBufferPool_Truncate(&v->mdmir_open, nblocks * BLCKSZ) < 0)
if (!MirroredBufferPool_Truncate(&v->mdmir_open, nblocks * BLCKSZ))
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not truncate relation %u/%u/%u to %u blocks: %m",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册