Hi,
sqlsmith doesn't like commit 4b0d28de06:
,----
| regression=> select * from pg_control_checkpoint();
| server closed the connection unexpectedly
| TRAP: FailedAssertion("!((atti->attalign) == 's')", File: "heaptuple.c",
Line: 126)
`----
On a build with assertions disabled, the statement fails with an error
instead:
,----
| regression=> select * from pg_control_checkpoint();
| ERROR: function return row and query-specified return row do not match
| DETAIL: Returned row contains 19 attributes, but query expects 18.
`----
The attached patch fixes it for me.
regards,
Andreas
>From b9c2394047f9418127eaa91fe251768d20add9a6 Mon Sep 17 00:00:00 2001
From: Andreas Seltenreich <[email protected]>
Date: Sat, 11 Nov 2017 17:26:46 +0100
Subject: [PATCH] Fix pg_control_checkpoint().
Commit 4b0d28de06 forgot to decrement the attribute count of the tuple
while removing prevCheckPoint, leading to failed assertions or errors
when using the function.
---
src/backend/utils/misc/pg_controldata.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/misc/pg_controldata.c b/src/backend/utils/misc/pg_controldata.c
index 1b5086a45d..dee6dfc12f 100644
--- a/src/backend/utils/misc/pg_controldata.c
+++ b/src/backend/utils/misc/pg_controldata.c
@@ -90,7 +90,7 @@ pg_control_checkpoint(PG_FUNCTION_ARGS)
* Construct a tuple descriptor for the result row. This must match this
* function's pg_proc entry!
*/
- tupdesc = CreateTemplateTupleDesc(19, false);
+ tupdesc = CreateTemplateTupleDesc(18, false);
TupleDescInitEntry(tupdesc, (AttrNumber) 1, "checkpoint_lsn",
LSNOID, -1, 0);
TupleDescInitEntry(tupdesc, (AttrNumber) 2, "redo_lsn",
--
2.11.0
--
Sent via pgsql-committers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers