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

Commit34c6e65

Browse files
committed
Make verify_compact_attribute available in non-assert builds
6f3820f adjusted the assert-enabled validation of the CompactAttributeto call a new external function to perform the validation. That commitmade it so the function was only available when building withUSE_ASSERT_CHECKING, and because TupleDescCompactAttr() is a staticinline function, the call to verify_compact_attribute() was compiledinto any extension which uses TupleDescCompactAttr(). This caused issuesfor such extensions when loading the assert-enabled extension intoPostgreSQL versions without asserts enabled due to that function beingunavailable in core.To fix this, make verify_compact_attribute() available unconditionally,but make it do nothing unless building with USE_ASSERT_CHECKING.Author: Andrew Kane <andrew@ankane.org>Reviewed-by: David Rowley <dgrowleyml@gmail.com>Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/CAOdR5yHfMEMW00XGo=v1zCVUS6Huq2UehXdvKnwtXPTcZwXhmg@mail.gmail.com
1 parenta9dcbb4 commit34c6e65

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

‎src/backend/access/common/tupdesc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ populate_compact_attribute(TupleDesc tupdesc, int attnum)
118118
populate_compact_attribute_internal(src,dst);
119119
}
120120

121-
#ifdefUSE_ASSERT_CHECKING
122121
/*
123122
* verify_compact_attribute
124123
*In Assert enabled builds, we verify that the CompactAttribute is
@@ -132,6 +131,7 @@ populate_compact_attribute(TupleDesc tupdesc, int attnum)
132131
void
133132
verify_compact_attribute(TupleDesctupdesc,intattnum)
134133
{
134+
#ifdefUSE_ASSERT_CHECKING
135135
CompactAttribute*cattr=&tupdesc->compact_attrs[attnum];
136136
Form_pg_attributeattr=TupleDescAttr(tupdesc,attnum);
137137
CompactAttributetmp;
@@ -150,9 +150,8 @@ verify_compact_attribute(TupleDesc tupdesc, int attnum)
150150

151151
/* Check the freshly populated CompactAttribute matches the TupleDesc's */
152152
Assert(memcmp(&tmp,cattr,sizeof(CompactAttribute))==0);
153-
}
154153
#endif
155-
154+
}
156155

157156
/*
158157
* CreateTemplateTupleDesc

‎src/include/access/tupdesc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ TupleDescAttr(TupleDesc tupdesc, int i)
158158

159159
#undef TupleDescAttrAddress
160160

161-
#ifdefUSE_ASSERT_CHECKING
162161
externvoidverify_compact_attribute(TupleDesc,intattnum);
163-
#endif
164162

165163
/*
166164
* Accessor for the i'th CompactAttribute element of tupdesc.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp