ECPG fix for mixed case cursor names

Поиск
Список
Период
Сортировка
Искать
От
Boszormenyi Zoltan
Тема
ECPG fix for mixed case cursor names
Дата
Msg-id
4C74FEE1.2070104@cybertec.at
Список
Дерево обсуждения
ECPG fix for mixed case cursor names Boszormenyi Zoltan <zb@cybertec.at>
Re: ECPG fix for mixed case cursor names Michael Meskes <meskes@postgresql.org>
Re: ECPG fix for mixed case cursor names Robert Haas <robertmhaas@gmail.com>
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 

#include 

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
Дата:
FAQ