Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 14D5E1109D9 for ; Mon, 6 Feb 2012 21:59:22 -0400 (AST) Received: from mahout.postgresql.org ([98.129.198.123]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RuaKv-000160-CA for pgsql-bugs@postgresql.org; Tue, 07 Feb 2012 01:59:20 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RuaKi-00046Q-5Y for pgsql-bugs@postgresql.org; Tue, 07 Feb 2012 01:59:00 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1RuaKh-0006bj-G8 for pgsql-bugs@postgresql.org; Tue, 07 Feb 2012 01:58:59 +0000 Date: Tue, 07 Feb 2012 01:58:59 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #6436: ecpg processed wrong variable name for host value of struct at EXEC SQL INSERT To: pgsql-bugs@postgresql.org From: a.tanaka77@gmail.com X-Pg-Spam-Score: -1.0 (-) X-Archive-Number: 201202/69 X-Sequence-Number: 32412 The following bug has been logged on the website: Bug reference: 6436 Logged by: Atsushi Tanaka Email address: a.tanaka77@gmail.com PostgreSQL version: 9.1.2 Operating system: CentOS 6.2 Description: = I tried preprocess my program source by ecpg. Then, ecpg processed wrong variable name for host value of struct. variable definition: ---------- EXEC SQL BEGIN DECLARE SECTION; struct _save_data { varchar vstring[256]; int idx; } save_data; EXEC SQL END DECLARE SECTION; ---------- call EXEC SQL: ---------- EXEC SQL INSERT INTO test_tbl ( title ) VALUES ( :save_data.vstring ); ---------- wrong preprocessed line: ---------- ECPGt_varchar,&(save_data.vstring),(long)256,(long)1,sizeof(struct varchar_save_data.vstring_1), ---------- correct: ---------- ECPGt_varchar,&(save_data.vstring),(long)256,(long)1,sizeof(struct varchar_vstring_1), ----------