pgsql: Fix bogus Name assignment in CreateStatistics

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix bogus Name assignment in CreateStatistics
Date: 2018-03-06 16:22:10
Message-ID: E1etFLu-0005uo-6o@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1ffb63a2a1767c3dd0c7611bed6383bd37bfbce6

Modified Files
--------------
src/backend/commands/statscmds.c | 7 +++++--
src/backend/parser/parse_utilcmd.c | 3 ++-
2 files changed, 7 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2018-03-06 16:23:21 Re: pgsql: Clone extended stats in CREATE TABLE (LIKE INCLUDING ALL)
Previous Message Peter Eisentraut 2018-03-06 15:58:00 pgsql: Tests for Kerberos/GSSAPI authentication