On 11/5/18 4:00 AM, Amit Kapila wrote: > On Sat, Nov 3, 2018 at 9:30 AM Amit Kapila <amit.kapil...@gmail.com> wrote: >> On Fri, Nov 2, 2018 at 6:41 PM Tomas Vondra >> <tomas.von...@2ndquadrant.com> wrote: >>> I'm sure >>> it's not the only place where we do something like this, and the other >>> places don't trigger the valgrind warning, so how do those places do >>> this? heapam seems to call fetch_att in the end, which essentially calls >>> Int32GetDatum/Int16GetDatum/CharGetDatum, so why not to use the same >>> trick here? >>> >> >> This is because, in zheap, we have omitted all alignment padding for >> pass-by-value types. See the description in my previous email [1]. I >> think here we need to initialize ret_datum at the beginning of the >> function unless you have some better idea. >> > > I have pushed a fix on the above lines in zheap-branch, but I am open > to change it if you have better ideas for the same. >
Thanks. Initializing the variable seems like the right fix here. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services