pgsql: ECPG: Make the preprocessor emit '; ' if the variable type for a

Поиск
Список
Период
Сортировка
От Michael Meskes
Тема pgsql: ECPG: Make the preprocessor emit '; ' if the variable type for a
Дата
Msg-id E1VlLi4-0000vv-Sa@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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>

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/5bffd42a3b0b049ea0e44a69c99ce3c3c5418af0

Modified Files
--------------
src/interfaces/ecpg/preproc/ecpg.trailer |    7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Michael Meskes
Дата:
Сообщение: pgsql: ECPG: Free the malloc()'ed variables in the test so it comes out
Следующее
От: Michael Meskes
Дата:
Сообщение: pgsql: ECPG: Make the preprocessor emit '; ' if the variable type for a