ECPG fix for mixed case cursor names

Поиск
Список
Период
Сортировка
От Boszormenyi Zoltan
Тема ECPG fix for mixed case cursor names
Дата
Msg-id 4C74FEE1.2070104@cybertec.at
обсуждение исходный текст
Ответы Re: ECPG fix for mixed case cursor names  (Robert Haas <robertmhaas@gmail.com>)
Re: ECPG fix for mixed case cursor names  (Michael Meskes <meskes@postgresql.org>)
Список pgsql-hackers
Hi,

PostgreSQL allows in plain SQL to declare a cursor
e.g. in all lower case and fetch from is in all upper case.
We need to allow this from ECPG, too, but strictly when
the cursor name is not in a variable. Otherwise this code
below doesn't notice the cursor's double declaration
and complains using an undeclared cursor:

======================================
#include <stdio.h>

#include <sqlda.h>

int main(void)
{
    EXEC SQL BEGIN DECLARE SECTION;
    char    *connstr = "zozo@localhost:5555";
    EXEC SQL END DECLARE SECTION;
    sqlda_t    *sqlda;

    EXEC SQL CONNECT TO :connstr;

    EXEC SQL DECLARE mycur CURSOR FOR SELECT * FROM t1;

    EXEC SQL DECLARE MYCUR CURSOR FOR SELECT * FROM t1;

    EXEC SQL OPEN mYCur;

    EXEC SQL FETCH ALL FROM mYcUr INTO DESCRIPTOR sqlda;

    EXEC SQL CLOSE MyCuR;

    EXEC SQL DISCONNECT ALL;

    return 0;
}
======================================

Patch is attached.

Best regards,
Zoltán Böszörményi


Вложения

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

Предыдущее
От: Max Bowsher
Дата:
Сообщение: Re: git: uh-oh
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: No documentation for filtering dictionary feature?