pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Meskes <meskes@postgresql.org>
To: davidr@openscg.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14801: ECPG core dump
Date: Mon, 11 Sep 2017 21:14:51 +0200
Message-ID: <20170911191451.abi7yqatrsn4spa4@feivel> (raw)
In-Reply-To: <20170906161212.25634.31573@wrigleys.postgresql.org>
References: <20170906161212.25634.31573@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On Wed, Sep 06, 2017 at 04:12:12PM +0000, davidr@openscg.com wrote:
> 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.

Could you please try the attached little patch to see if it works with your
real life case? It does work with the test case. I will also git push as soon
as I'm back on the ground.

Thanks.

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

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Attachments:

ecpg.patch (text/x-diff, 930B) download commit e39533aba0adccdff71ee259671cbe81771280a1 Author: Michael Meskes <meskes@postgresql.org> Date: Mon Sep 11 21:10:36 2017 +0200 Fixed ECPG to correctly handle out-of-scope cursor declarations with pointers or array variables. diff --git a/src/interfaces/ecpg/preproc/ecpg.header b/src/interfaces/ecpg/preproc/ecpg.header index 2562366bbe..a52da01b1f 100644 --- a/src/interfaces/ecpg/preproc/ecpg.header +++ b/src/interfaces/ecpg/preproc/ecpg.header @@ -352,7 +352,7 @@ adjust_outofscope_cursor_vars(struct cursor *cur) else { newvar = new_variable(cat_str(4, mm_strdup("("), - mm_strdup(ecpg_type_name(ptr->variable->type->type)), + mm_strdup(ecpg_type_name(ptr->variable->type->u.element->type)), mm_strdup(" *)(ECPGget_var("), mm_strdup(var_text)), ECPGmake_array_type(ECPGmake_simple_type(ptr->variable->type->u.element->type,

view thread (2+ messages)

Message-ID: <20170911191451.abi7yqatrsn4spa4@feivel>
Permalink:  ../20170911191451.abi7yqatrsn4spa4@feivel/
Also on:    postgresql.org/message-id/20170911191451.abi7yqatrsn4spa4@feivel

 ·  · 

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: meskes@postgresql.org, davidr@openscg.com
  Subject: Re: BUG #14801: ECPG core dump
  In-Reply-To: <20170911191451.abi7yqatrsn4spa4@feivel>
  References: <20170906161212.25634.31573@wrigleys.postgresql.org> <20170911191451.abi7yqatrsn4spa4@feivel>

* 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