On Wed, Aug 05, 2009 at 11:08:26AM +0200, Boszormenyi Zoltan wrote: > I have looked at it. The code seems to be invalid.
Yes, it is, I was too lazy to make it valid. If you just allocate the memory for the variable in get_var() it becomes valid. > I tried to compile your code (with my previous "fix" > in place, so at least :myvar is processed and C code is output): Yes, but incorrect one. > Some systems (stack-protector extensions to GCC, etc) > make the code segfault immediately as soon as the first > FETCH statement tries to touch the lost memory area. > Just because ECPG does some tricks with ECPG_informix_set_var() > and ECPG_informix_get_var() converting variable reference > to runtime pointer values, the code wouldn't get magically valid. Again, this doesn't matter in this case as we try to get the preprocessor to work with a test case as small as possible. > I did and I don't understand. I think it's just a bug > in ESQL/C to accept such constructs. I do not like this "feature" either, but it's there and therefore should work in our compatibility mode. And it does with non-struct variables. Just look at test/compat_informix/test_informix.pgc for a real and working example. Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org ICQ: 179140304, AIM/Yahoo/Skype: michaelmeskes, Jabber: mes...@jabber.org Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL! -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers