Bug #606: exec sql ifdef, ... incorrect parsing

Поиск
Список
Период
Сортировка
От pgsql-bugs@postgresql.org
Тема Bug #606: exec sql ifdef, ... incorrect parsing
Дата
Msg-id 20020304065741.1878C47587E@postgresql.org
обсуждение исходный текст
Список pgsql-bugs
Nicolas BAZIN (nbazin@ingenico.com.au) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
exec sql ifdef, ... incorrect parsing

Long Description
When exec sql ifdef test; is used with the definition of a statement bloc, a premature EOF is reached:




Sample Code
Lets modify test1.pgc with

static void warn(void)
{
    fprintf(stderr, "Warning: At least one column was truncated\n");
}

/* comment */
exec sql define test 1;
exec sql ifdef test;
exec sql define AMOUNT 6;
exec sql else;
exec sql define AMOUNT 7;
exec sql endif;

exec sql type intarray is int[AMOUNT];
exec sql type string is char(8);

typedef int intarray[AMOUNT];

int
main ()
{
exec sql begin declare section;
        intarray amount;
    int increment=100;
        char name[AMOUNT][8];
    char letter[AMOUNT][1];
exec sql ifdef test;
    struct name_letter_struct
    {
        char name[8];
        int amount;
        char letter;
    } name_letter[AMOUNT];
exec sql endif;
        struct ind_struct
        {
                short a;
                short b;
                short c;
        } ind[AMOUNT];
    char command[128];
    char *connection="pm";
exec sql end declare section;
    exec sql var name is string(AMOUNT);
    char msg[128];
        FILE *dbgs;
        int i,j;
....

[postgres@CVS test]$ gmake
../preproc/ecpg -I./../include test1.pgc
test1.pgc:45: ERROR: eof - Missing 'EXEC SQL ENDIF;'
gmake: *** [test1.c] Error 3
gmake: *** Deleting file `test1.c'


No file was uploaded with this report

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

Предыдущее
От: Steven Núñez
Дата:
Сообщение: Re: Make check problem with 7.2
Следующее
От: Reinhard Max
Дата:
Сообщение: Re: Indexes not always used after inserts/updates/vacuum