pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joaquim Salles <joaquimsalles@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: BUG #5762: ecpg
Date: Mon, 22 Nov 2010 15:41:06 GMT
Message-ID: <201011221541.oAMFf6KA058520@wwwmaster.postgresql.org> (raw)


The following bug has been logged online:

Bug reference:      5762
Logged by:          Joaquim Salles
Email address:      joaquimsalles@gmail.com
PostgreSQL version: 1.8.3
Operating system:   linux - Centos 5.3
Description:        ecpg
Details: 

I'm porting  a pro * c (oracle) to ecpg.

In oracle I have:

 EXEC SQL BEGIN DECLARE SECTION;

 typedef struct _SItemInfo
 {
     varchar strNome [40 +1];

 SItemInfo};

 SItemInfo sitem;

 EXEC SQL END DECLARE SECTION;


  EXEC SQL SELECT name INTO: FROM sitem delivery;

it generates the source and compile c normally. However when I generate in
ecpg have:


 typedef struct {_SItemInfo
# Line 509 "/ home / Development / Delivery / gserv.pgc"
  varchar_strNome_509 struct {int len; char arr [40 + 1];} strNome;
 SItemInfo};

# Line 511 "/ home / Development / Delivery / gserv.pgc"


# Line 513 "/ home / Development / Delivery / gserv.pgc"
 SItemInfo sitem;
/ * Exec sql end declare section * /
# Line 515 "/ home / Development / Delivery / gserv.pgc"



  {ECPGdo (__LINE__, 0, 1, NULL, 0, ECPGst_normal "select name
from delivery, "ECPGt_EOIT,
       ECPGt_varchar, & (sItem.strNome), (long) 40 + 1, (long) 1, sizeof
(struct
varchar_strNome_509)
       ECPGt_NO_INDICATOR, NULL, 0L, 0L, 0L, ECPGt_EORT);}
# Line 518 "/ home / Development / Delivery / gserv.ppc

At C code does not exist in the structure sizeof (struct
varchar_strNome_509) because
she 'and a member of struct SItemInfo in the above case.

Workaround: use "char" instead "varchar".

Thanks

Joaquim Salles



view thread (2+ messages)  latest in thread

Message-ID: <201011221541.oAMFf6KA058520@wwwmaster.postgresql.org>
Permalink:  ../201011221541.oAMFf6KA058520@wwwmaster.postgresql.org/
Also on:    postgresql.org/message-id/201011221541.oAMFf6KA058520@wwwmaster.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: joaquimsalles@gmail.com
  Subject: Re: BUG #5762: ecpg
  In-Reply-To: <201011221541.oAMFf6KA058520@wwwmaster.postgresql.org>
  References: <201011221541.oAMFf6KA058520@wwwmaster.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox