Обсуждение: pgsql: Several fixes to array handling in ecpg.

Поиск
Список
Период
Сортировка

pgsql: Several fixes to array handling in ecpg.

От
Michael Meskes
Дата:
Several fixes to array handling in ecpg.

Patches by Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/f9179685371b74bf4752bf3f87846e5625cf91fa

Modified Files
--------------
src/interfaces/ecpg/preproc/type.c                 |   17 +-
src/interfaces/ecpg/test/ecpg_schedule             |    1 +
.../ecpg/test/expected/preproc-array_of_struct.c   |    8 +-
.../ecpg/test/expected/preproc-outofscope.c        |   40 +--
.../ecpg/test/expected/preproc-pointer_to_struct.c |  293 ++++++++++++++++++++
.../test/expected/preproc-pointer_to_struct.stderr |   86 ++++++
.../test/expected/preproc-pointer_to_struct.stdout |   25 ++
src/interfaces/ecpg/test/expected/preproc-type.c   |    6 +-
.../ecpg/test/expected/preproc-variable.c          |   12 +-
src/interfaces/ecpg/test/preproc/Makefile          |    6 +-
.../ecpg/test/preproc/pointer_to_struct.pgc        |  100 +++++++
11 files changed, 556 insertions(+), 38 deletions(-)


Re: pgsql: Several fixes to array handling in ecpg.

От
Andres Freund
Дата:
Hi,

On 2014-04-09 09:24:08 +0000, Michael Meskes wrote:
> Several fixes to array handling in ecpg.

What's actually fixed by this?

The patch, or at least the comments, don't look entirely finished:
+       /*
+        * If siz i.e. the size of structure of which this variable is part of,
+        * that gives the offset to the next element, if required
+        */


Greetings,

Andres Freund

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Re: pgsql: Several fixes to array handling in ecpg.

От
Michael Meskes
Дата:
> > Several fixes to array handling in ecpg.
>
> What's actually fixed by this?

There were a couple of reports that data got filled into array incorrectly and at least some of those were fixed by the
patches.

> The patch, or at least the comments, don't look entirely finished:
> +       /*
> +        * If siz i.e. the size of structure of which this variable is part of,
> +        * that gives the offset to the next element, if required
> +        */

Not sure what you're trying to tell me here, other than that the wording is unclear.

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 gmail dot com
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL


Re: pgsql: Several fixes to array handling in ecpg.

От
Andres Freund
Дата:
On 2014-04-09 12:46:35 +0200, Michael Meskes wrote:
> > > Several fixes to array handling in ecpg.
> >
> > What's actually fixed by this?
>
> There were a couple of reports that data got filled into array incorrectly and at least some of those were fixed by
thepatches. 

It'd be useful to describe that in the commit...

> > The patch, or at least the comments, don't look entirely finished:
> > +       /*
> > +        * If siz i.e. the size of structure of which this variable is part of,
> > +        * that gives the offset to the next element, if required
> > +        */
>
> Not sure what you're trying to tell me here, other than that the wording is unclear.

To me that looks like somebody tried to rewrite a comment and stopped
somewhere in the middle. I don't think anybody trying to read that code
in the future is going to understand it.

Greetings,

Andres Freund

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services