pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #5812: ecpg problem with array of varchar when using dimension name with length > 12
2+ messages / 2 participants
[nested] [flat]

* BUG #5812: ecpg problem with array of varchar when using dimension name with length > 12
@ 2011-01-04 14:44  Jean-Baptiste Veslin <jean-baptiste.veslin@meteo.fr>
  0 siblings, 1 reply; 2+ messages in thread

From: Jean-Baptiste Veslin @ 2011-01-04 14:44 UTC (permalink / raw)
  To: pgsql-bugs


The following bug has been logged online:

Bug reference:      5812
Logged by:          Jean-Baptiste Veslin
Email address:      jean-baptiste.veslin@meteo.fr
PostgreSQL version: 9.0.1
Operating system:   linux CentOS 5.4
Description:        ecpg problem with array of varchar when using dimension
name with length > 12
Details: 

When using a variable to give dimension of an array of varchar, ecpg
products a coredump if the the variable name is longer than 12.

Exemple, this doesn't work because length of MAX_COL_IN_IND is 14 :

#define MAX_COL_IN_IND 10 #perhaps in an include file
(...)
EXEC SQL BEGIN DECLARE SECTION;
VARCHAR col_name[MAX_COL_IN_IND][26];
EXEC SQL END DECLARE SECTION;

This problem seems to be because of the static declaration "char dim[14L]"
in ecpg.trailer

I think it wouldn't be very difficult to calculate the dimension of "dim"
dynamically (strlen(dimension) + 2)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #5812: ecpg problem with array of varchar when using dimension name with length > 12
@ 2011-01-08 17:34  Michael Meskes <meskes@postgresql.org>
  parent: Jean-Baptiste Veslin <jean-baptiste.veslin@meteo.fr>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Meskes @ 2011-01-08 17:34 UTC (permalink / raw)
  To: Jean-Baptiste Veslin <jean-baptiste.veslin@meteo.fr>; +Cc: pgsql-bugs

On Tue, Jan 04, 2011 at 02:44:25PM +0000, Jean-Baptiste Veslin wrote:
> Description:        ecpg problem with array of varchar when using dimension
> name with length > 12
> ...
> This problem seems to be because of the static declaration "char dim[14L]"
> in ecpg.trailer
> 
> I think it wouldn't be very difficult to calculate the dimension of "dim"
> dynamically (strlen(dimension) + 2)

Thanks for spotting this, I have no idea why this fixed size limit is in there
anyway. I will remove it.

Michael
-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
Jabber: michael.meskes at googlemail dot com
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2011-01-08 17:34 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-01-04 14:44 BUG #5812: ecpg problem with array of varchar when using dimension name with length > 12 Jean-Baptiste Veslin <jean-baptiste.veslin@meteo.fr>
2011-01-08 17:34 ` Michael Meskes <meskes@postgresql.org>

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