pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix possible omission of variable storage markers in ECPG.
Date: Fri, 09 Sep 2022 19:34:21 +0000
Message-ID: <E1oWjlc-002Bpa-VE@gemulon.postgresql.org> (raw)

Fix possible omission of variable storage markers in ECPG.

The ECPG preprocessor converted code such as

static varchar str1[10], str2[20], str3[30];

into

static  struct varchar_1  { int len; char arr[ 10 ]; }  str1 ;
        struct varchar_2  { int len; char arr[ 20 ]; }  str2 ;
        struct varchar_3  { int len; char arr[ 30 ]; }  str3 ;

thus losing the storage attribute for the later variables.
Repeat the declaration for each such variable.

(Note that this occurred only for variables declared "varchar"
or "bytea", which may help explain how it escaped detection
for so long.)

Andrey Sokolov

Discussion: https://postgr.es/m/942241662288242@mail.yandex.ru

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a6618842fac3baaf486dda5b563c61bbdb7a06ae

Modified Files
--------------
src/interfaces/ecpg/preproc/ecpg.trailer           |   8 +-
src/interfaces/ecpg/preproc/type.h                 |   1 +
.../ecpg/test/expected/preproc-variable.c          |  93 +++++++-----
.../ecpg/test/expected/preproc-variable.stderr     | 162 ++++++++++-----------
.../ecpg/test/expected/preproc-variable.stdout     |   1 +
src/interfaces/ecpg/test/preproc/variable.pgc      |   9 ++
6 files changed, 151 insertions(+), 123 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1oWjlc-002Bpa-VE@gemulon.postgresql.org>
Permalink:  ../E1oWjlc-002Bpa-VE@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oWjlc-002Bpa-VE@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix possible omission of variable storage markers in ECPG.
  In-Reply-To: <E1oWjlc-002Bpa-VE@gemulon.postgresql.org>
  References: <E1oWjlc-002Bpa-VE@gemulon.postgresql.org>

* 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