1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-17 17:02:08 +03:00

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 5564c11815, so backpatch this fix to REL_10_STABLE, like that
commit.

While at it, fix a slightly misleading comment, pointed out by David
Rowley.
This commit is contained in:
Alvaro Herrera
2018-03-06 13:17:13 -03:00
parent 4c831aeaa7
commit 1ffb63a2a1
2 changed files with 7 additions and 3 deletions

View File

@ -2250,7 +2250,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)