| From: | Andrey Sokolov <a(dot)sokolov(at)arenadata(dot)io> |
|---|---|
| To: | "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | [BUG] Storage declaration in ECPG |
| Date: | 2022-09-04 10:49:53 |
| Message-ID: | 942241662288242@mail.yandex.ru |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
The ECPG preprocessor converts the code
"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 ;".
Storage declaration applies only to the first structure.
The patch in the attachment fixes the bug. Storage declaration will be repeated before each structure.
The patch is on github too: https://github.com/andr-sokolov/postgresql/commit/c8f8fc7a211938569e7d46c91a428d8cb25b6f9c
--
Andrey Sokolov
Arenadata https://arenadata.tech/
| Attachment | Content-Type | Size |
|---|---|---|
| unknown_filename | text/html | 846 bytes |
| 0001-Fix-storage-declaration-in-ECPG.patch | text/x-diff | 16.9 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Zhihong Yu | 2022-09-04 10:58:06 | Re: freeing LDAPMessage in CheckLDAPAuth |
| Previous Message | Dilip Kumar | 2022-09-04 10:20:01 | Re: Add 64-bit XIDs into PostgreSQL 15 |