Fix possible omission of variable storage markers in ECPG.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 8fe26bca1c9754b72eb08cea46cf901b61cc9652
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2022-09-09T19:34:04Z
Releases: 10.23
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

Files

Discussion