Skip to content

Commit ac12329

Browse files
authored
Merge pull request #114 from NikitaFeodonit/master
Commit postgres/postgres@c456e39 added an assertion to the BlessTupleDesc function requiring a call to the TupleDescFinalize function before calling BlessTupleDesc. Add these calls; without them, the issue appears in the debug build. Also fix warnings -Wstrict-prototypes and -Wold-style-definition Reported-by: Georgy Shelkovy <@RekGRpth> Author: Nikita Kirin <@NikitaFeodonit>, Georgy Shelkovy <@RekGRpth>
2 parents c4d4305 + bd21439 commit ac12329

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

collector.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ send_profile(HTAB *profile_hash, shm_mq_handle *mqh)
283283
* Make hash table for wait profile.
284284
*/
285285
static HTAB *
286-
make_profile_hash()
286+
make_profile_hash(void)
287287
{
288288
HASHCTL hash_ctl;
289289

pg_wait_sampling.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,9 @@ pg_wait_sampling_get_current(PG_FUNCTION_ARGS)
524524
TEXTOID, -1, 0);
525525
TupleDescInitEntry(tupdesc, (AttrNumber) 4, "queryid",
526526
INT8OID, -1, 0);
527-
527+
#if PG_VERSION_NUM >= 190000
528+
TupleDescFinalize(tupdesc);
529+
#endif
528530
funcctx->tuple_desc = BlessTupleDesc(tupdesc);
529531

530532
LWLockAcquire(ProcArrayLock, LW_SHARED);
@@ -757,6 +759,9 @@ pg_wait_sampling_get_profile(PG_FUNCTION_ARGS)
757759
INT8OID, -1, 0);
758760
TupleDescInitEntry(tupdesc, (AttrNumber) 5, "count",
759761
INT8OID, -1, 0);
762+
#if PG_VERSION_NUM >= 190000
763+
TupleDescFinalize(tupdesc);
764+
#endif
760765
funcctx->tuple_desc = BlessTupleDesc(tupdesc);
761766

762767
MemoryContextSwitchTo(oldcontext);
@@ -882,6 +887,9 @@ pg_wait_sampling_get_history(PG_FUNCTION_ARGS)
882887
TEXTOID, -1, 0);
883888
TupleDescInitEntry(tupdesc, (AttrNumber) 5, "queryid",
884889
INT8OID, -1, 0);
890+
#if PG_VERSION_NUM >= 190000
891+
TupleDescFinalize(tupdesc);
892+
#endif
885893
funcctx->tuple_desc = BlessTupleDesc(tupdesc);
886894

887895
MemoryContextSwitchTo(oldcontext);

0 commit comments

Comments
 (0)