BUG #5172: ecpg - cursor with regexp containing '.*/' fails to compile with gcc

Поиск
Список
Период
Сортировка
От Viisard
Тема BUG #5172: ecpg - cursor with regexp containing '.*/' fails to compile with gcc
Дата
Msg-id 200911071856.nA7IuavI066952@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #5172: ecpg - cursor with regexp containing '.*/' fails to compile with gcc
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      5172
Logged by:          Viisard
Email address:      viisard@hotmail.com
PostgreSQL version: 8.4.1
Operating system:   Fedora 11 (Linux 2.6.30.9-96.fc11.i686.PAE)
Description:        ecpg - cursor with regexp containing '.*/' fails to
compile with gcc
Details:

I'm using ecpg (PostgreSQL 8.4.1) 4.5.0. It fails to generate valid c file,
when a cursor with a regular expression (in probably could be any string)
containing '*/'.

The line in foo.cpg:
...
EXEC SQL DECLARE foo CURSOR FOR SELECT SUBSTRING('/foo/bar','.*/');
...

is translated into:
foo.c:

    /* declare foo cursor for select substring ( '/foo/bar' , '.*/' ) */
#line 9 "foo.cpg"

    { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare foo cursor for
select substring ( '/foo/bar' , '.*/' )", ECPGt_EOIT, ECPGt_EORT);}

There is a simple workaround for this by using '.*[/]' as the regexp.

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

Предыдущее
От: "digital.death@gmx.it"
Дата:
Сообщение: odd deadlock on CREATE TABLE AS SELECT
Следующее
От: Tom Lane
Дата:
Сообщение: Re: odd deadlock on CREATE TABLE AS SELECT