提交 e74fc536 编写于 作者: D Daniel Gustafsson 提交者: Adam Berlin

Disable sanity assertion for itempointer offsetnumber

Commit 99360f54 extended the offset
numbers in the GIN posting list to 16 bits over upstream who use
11 bits. This however means that the assertion around ip_posid is
no longer valid as it's always true, causing a compiler warning:

ginpostinglist.c:89:24: warning: result of comparison of constant
                                 65536 with expression of type
								 'OffsetNumber' (aka 'unsigned short')
								 is always true
[-Wtautological-constant-out-of-range-compare]
Assert(iptr->ip_posid < (1 << MaxHeapTuplesPerPageBits));
~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../src/include/c.h:784:10: note: expanded from macro 'Assert'
Trap(!(condition), "FailedAssertion")
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../src/include/c.h:766:28: note: expanded from macro 'Trap'
if ((assert_enabled) && (condition))
^~~~~~~~~
1 warning generated.

Fix by commenting out the assertion with preprocessor blocks in an
attempt to make future merge conflicts easier to resolve.

A previous version of this patch was reviewed by Adam Berlin.
上级 0348582e
......@@ -86,7 +86,14 @@ itemptr_to_uint64(const ItemPointer iptr)
uint64 val;
Assert(ItemPointerIsValid(iptr));
/*
* Greenplum allow 16 bits for the offsetnumber, which turns the below
* upstream assertion into an always-true comparison which generates a
* compiler warning; thus we need to keep this commented out.
*/
#if 0
Assert(iptr->ip_posid < (1 << MaxHeapTuplesPerPageBits));
#endif
val = iptr->ip_blkid.bi_hi;
val <<= 16;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册