]> git.ipfire.org Git - thirdparty/postgresql.git/commit
ECPG: Make the preprocessor emit ';' if the variable type for a list of
authorMichael Meskes <meskes@postgresql.org>
Tue, 26 Nov 2013 16:12:39 +0000 (17:12 +0100)
committerMichael Meskes <meskes@postgresql.org>
Tue, 26 Nov 2013 16:31:39 +0000 (17:31 +0100)
commit7bee2e3e55f4503eec65783bd6d16f8291537c25
tree6934229fb05e3014cb7bdb3fcaeac39afaae0118
parentcd5316f67d5f6e110205d47d27b11eb644720e4b
ECPG: Make the preprocessor emit ';' if the variable type for a list of
variables is varchar. This fixes this test case:

int main(void)
{
    exec sql begin declare section;
    varchar a[50], b[50];
    exec sql end declare section;

    return 0;
}

Since varchars are internally turned into custom structs and
the type name is emitted for these variable declarations,
the preprocessed code previously had:

struct varchar_1  { ... }  a _,_  struct varchar_2  { ... }  b ;

The comma in the generated C file was a syntax error.

There are no regression test changes since it's not exercised.

Patch by Boszormenyi Zoltan <zb@cybertec.at>

Conflicts:
src/interfaces/ecpg/preproc/ecpg.trailer
src/interfaces/ecpg/preproc/ecpg.trailer