aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/cluster.c
diff options
context:
space:
mode:
authorTomas Vondra <tomas.vondra@postgresql.org>2019-03-28 20:03:14 +0100
committerTomas Vondra <tomas.vondra@postgresql.org>2019-03-28 20:03:14 +0100
commit62bf0fb35cb370e9650981ff0333d198e955bd54 (patch)
tree452a226ff7ede73564567659b2de49b1174e3b7e /src/backend/commands/cluster.c
parentf3afbbdae9b6ca04a6d2b224a8dfd5959d8a17ea (diff)
downloadpostgresql-62bf0fb35cb370e9650981ff0333d198e955bd54.tar.gz
postgresql-62bf0fb35cb370e9650981ff0333d198e955bd54.zip
Fix deserialization of pg_mcv_list values
There were multiple issues in deserialization of pg_mcv_list values. Firstly, the data is loaded from syscache, but the deserialization was performed after ReleaseSysCache(), at which point the data might have already disappeared. Fixed by moving the calls in statext_mcv_load, and using the same NULL-handling code as existing stats. Secondly, the deserialized representation used pointers into the serialized representation. But that is also unsafe, because the data may disappear at any time. Fixed by reworking and simplifying the deserialization code to always copy all the data. And thirdly, when deserializing values for types passed by value, the code simply did memcpy(d,s,typlen) which however does not work on bigendian machines. Fixed by using fetch_att/store_att_byval.
Diffstat (limited to 'src/backend/commands/cluster.c')
0 files changed, 0 insertions, 0 deletions