BUG #14801: ECPG core dump

From: davidr(at)openscg(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Cc: davidr(at)openscg(dot)com
Subject: BUG #14801: ECPG core dump
Date: 2017-09-06 16:12:12
Message-ID: 20170906161212.25634.31573@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: 14801
Logged by: David Rader
Email address: davidr(at)openscg(dot)com
PostgreSQL version: 9.6.4
Operating system: CentOS 7
Description:

Using a int* variable as a where-clause parameter in a declare cursor
construct causes ECPG to Abort (core dump). Using an int variable works
correctly (as expected), and using a pointer type in where clause in a
simple select into works.

$ /usr/pgsql-9.6/bin/ecpg bug1.pgc
Aborted (core dumped)
$ cat bug1.pgc
int main( )

{

EXEC SQL BEGIN DECLARE SECTION;
int iparm = 5, iparm2;
int *pparm = &iparm;
int *outparm = &iparm2;
EXEC SQL END DECLARE SECTION;

// this runs through ECPG with no warning
/*
EXEC SQL
select 2 into :outparm from foo
where foo.bar = :pparm;
*/

// this causes Abort (core dumped)
EXEC SQL DECLARE buggy CURSOR FOR
select 2 from foo
where foo.bar = :pparm;

return( 0 );

}

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Francisco Olarte 2017-09-06 16:43:34 Re: BUG #14800: substring produces different results with similar types
Previous Message Tom Lane 2017-09-06 15:37:26 Re: BUG #14800: substring produces different results with similar types