From e20dd6a13d870f5c98a163031b38ba23753e628c Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 6 Mar 2018 13:17:13 -0300 Subject: Fix bogus Name assignment in CreateStatistics Apparently, it doesn't work to use a plain cstring as a Name datum: you may end up having random bytes because of failing to zero the bytes after the terminating \0, as indicated by valgrind. I introduced this bug in 5564c1181548, so backpatch this fix to REL_10_STABLE, like that commit. While at it, fix a slightly misleading comment, pointed out by David Rowley. --- src/backend/parser/parse_utilcmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/backend/parser/parse_utilcmd.c') diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index ed7b79d4230..b3367f0cd4b 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -2255,7 +2255,8 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt) * transformExtendedStatistics * Handle extended statistic objects * - * Right now, there's nothing to do here, so we just copy the list. + * Right now, there's nothing to do here, so we just append the list to + * the existing "after" list. */ static void transformExtendedStatistics(CreateStmtContext *cxt) -- cgit v1.2.3