Re: [PATCH] ECPG bug fix in preproc when indicator struct isshorter than record struct - Mailing list pgsql-hackers

From Michael Meskes
Subject Re: [PATCH] ECPG bug fix in preproc when indicator struct isshorter than record struct
Date
Msg-id 1515852136.2127.9.camel@postgresql.org
Whole thread Raw
In response to [PATCH] ECPG bug fix in preproc when indicator struct is shorter thanrecord struct  ("Rader, David" <davidr@openscg.com>)
Responses Re: [PATCH] ECPG bug fix in preproc when indicator struct is shorterthan record struct
List pgsql-hackers
> Attached is a proposed patch to fix a bug in the ECPG preprocessor
> that generates application code that core dumps at run-time. When the
> input pgc code uses a record struct for returning query results and
> uses an indicator struct that has fewer fields than the record
> struct, the generated .c code will compile with no warning but core
> dump. This situation comes up when a developer adds a field to an
> existing query, adds the field to the record struct and forgets to
> add the field to the indicator struct.

Thanks for spotting and fixing, committed.

> The attached sample files are a simple sample of pgc code that can be
> used to see the difference in before and after generation and the
> before and after generated code.

Next time it would be nice if the test case was self-contained. Wasn't
that difficult to figure out the table layout, though. :)

> If accepted, this bug fix can be back ported to earlier versions of
> ecpg as well.

As usual this will be done after a couple of days, if no problems
appear. I'm pretty sure there won't but sticking to my workflow here.

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! SF 49ers! Use Debian GNU/Linux, PostgreSQL


pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: WIP: a way forward on bootstrap data
Next
From: "Rader, David"
Date:
Subject: Re: [PATCH] ECPG bug fix in preproc when indicator struct is shorterthan record struct