BUG #3181: ecpg generating wrong code

From: "Steve Gieseking" <steve(dot)gieseking(at)camotion(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3181: ecpg generating wrong code
Date: 2007-03-22 05:34:05
Message-ID: 200703220534.l2M5Y5mj056374@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 3181
Logged by: Steve Gieseking
Email address: steve(dot)gieseking(at)camotion(dot)com
PostgreSQL version: 8.2.3
Operating system: Linux Fedora Core 6
Description: ecpg generating wrong code
Details:

I am maintaining code that uses ecpg. The following query was working with
the previous version of ecpg:

exec sql SELECT count(PortNum) INTO :cnt FROM Serial
WHERE ProjectId = :prjId and Enable = true;

After upgrading, the code is produced incorrectly. It now generates code as
follows:

{ ECPGdo(__LINE__, 0, 1, NULL, "select count ( PortNum ) from Serial
where ProjectId = ? and ensable = true ",
ECPGt_int,&(prjId),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_int,&(cnt),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);

The problem is the translation to ensable. This appears to be caused by the
file 'preproc.y' at the line:

| ENABLE_P { $$ = make_str("ensable"); }

Changing this to 'enable', fixes the problem.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message CN Liou 2007-03-22 06:45:40 BUG #3182: Cannot make libpq with BCC 5.5
Previous Message TANIDA Yutaka 2007-03-22 05:03:17 "Relation not found" error but table exits.