X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 2F45AD1B432 for ; Sat, 27 Dec 2003 07:36:37 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 09020-10 for ; Sat, 27 Dec 2003 03:35:49 -0400 (AST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.184]) by svr1.postgresql.org (Postfix) with ESMTP id 6AEAED1B42F for ; Sat, 27 Dec 2003 03:35:47 -0400 (AST) Received: from [212.227.126.206] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1Aa8zE-0001ZN-00 for pgsql-interfaces@postgresql.org; Sat, 27 Dec 2003 08:35:48 +0100 Received: from [80.128.65.7] (helo=FRITZweb) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1Aa8zE-0001FN-00 for pgsql-interfaces@postgresql.org; Sat, 27 Dec 2003 08:35:48 +0100 From: =?iso-8859-1?Q?J=FCrgen_Cappel?= To: Subject: ecpg with nested structure Date: Sat, 27 Dec 2003 08:36:44 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:18ffa34e0aa20c651c9363a5f5f711d8 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/53 X-Sequence-Number: 4662 Hello, while porting an application from CA/Ingres to PostgreSQL I came across a segmentation fault by ecpg. The code looks something like this: EXEC SQL BEGIN DECLARE SECTION; struct bnd_a { struct bnd_b { char myvar[31]; } bnd_b[5]; } bnd_a[5]; EXEC SQL END DECLARE SECTION; myfunction() { EXEC SQL DECLARE mycursor CURSOR FOR SELECT mycolumn FROM mytable; EXEC SQL OPEN mycursor; EXEC SQL FETCH mycursor INTO :bnd_a[0].bnd_b[0].myvar; EXEC SQL CLOSE mycursor; } Versions are: ecpg (PostgreSQL 7.4) 3.0.0 Linux scaleo 2.4.18-4GB #1 Wed Mar 27 13:57:05 UTC 2002 i686 unknown Stack trace: #0 0x40163a40 in strcmp () from /lib/libc.so.6 #1 0x080678d2 in find_struct_member (name=0x80c0f88 "bnd_a[0].bnd_b[0]", str=0x80c0f97 "0]", members=0x80c1170, brace_level=0) at variable.c:37 #2 0x08067c1f in find_struct_member (name=0x80c0f88 "bnd_a[0].bnd_b[0]", str=0x80c0f91 "bnd_b[0]", members=0x80c11a0, brace_level=0) at variable.c:110 #3 0x08067ea6 in find_struct (name=0x80c0f88 "bnd_a[0].bnd_b[0]", next=0x80c0f8d "[0].bnd_b[0]", end=0x80c0f90 ".bnd_b[0]") at variable.c:185 #4 0x08067fb3 in find_variable (name=0x80c0f88 "bnd_a[0].bnd_b[0]") at variable.c:238 #5 0x080604c0 in yyparse () at preproc.y:6152 #6 0x08066632 in main (argc=4, argv=0xbffff284) at ecpg.c:394 #7 0x401089ed in __libc_start_main () from /lib/libc.so.6 Are nested structures not supported by ecpg ? Thanks for any information, Jürgen