[HACKERS] TupleDescInitEntry failing to initialize varlen members

2011-12-01 Thread Alvaro Herrera

Hi,

I just noticed in gdb that TupleDescInitEntry does not initialize
attacl, attoptions, attfdwoptions.  This is probably not very serious
(otherwise we'd have bugs about it), but it is noticeable in tupdescs
constructed by the executor, at least ExecTypeFromTL:

(gdb) print *tupDesc-attrs[2]
$6 = {attrelid = 0, attname = {data = c, '\000' repeats 62 times}, atttypid 
= 1114, 
  attstattarget = -1, attlen = 8, attnum = 3, attphysnum = 3, attlognum = 3, 
attndims = 0, 
  attcacheoff = -1, atttypmod = -1, attbyval = 1 '\001', attstorage = 112 'p', 
attalign = 100 'd', 
  attnotnull = 0 '\000', atthasdef = 0 '\000', attisdropped = 0 '\000', 
attislocal = 1 '\001', 
  attinhcount = 0, attcollation = 0, attacl = {2139062142}, attoptions = {{
  vl_len_ = \177\177\177\177, vl_dat = \177}}, attfdwoptions = {{
  vl_len_ = \177\177\177\177, vl_dat = \177}}}


Does anybody think this is worth fixing?

-- 
Álvaro Herrera alvhe...@alvh.no-ip.org

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] TupleDescInitEntry failing to initialize varlen members

2011-12-01 Thread Tom Lane
Alvaro Herrera alvhe...@alvh.no-ip.org writes:
 I just noticed in gdb that TupleDescInitEntry does not initialize
 attacl, attoptions, attfdwoptions.

Indeed not, because it's not building a tuple.  It's building an array
of C structs, and there's nothing useful to do with those fields.

(Robert's proposal to not even have such fields be C-visible might make
you feel better.)

regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers