BUG #6436: ecpg processed wrong variable name for host value of struct at EXEC SQL INSERT

From: a(dot)tanaka77(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6436: ecpg processed wrong variable name for host value of struct at EXEC SQL INSERT
Date: 2012-02-07 01:58:59
Message-ID: E1RuaKh-0006bj-G8@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 6436
Logged by: Atsushi Tanaka
Email address: a(dot)tanaka77(at)gmail(dot)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),
----------

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2012-02-07 17:41:38 Re: BUG #6375: tsearch does not recognize all valid emails
Previous Message Tom Lane 2012-02-06 20:48:46 Re: BUG #6425: Bus error in slot_deform_tuple