errors when there is a bit literal in ecpg

Поиск
Список
Период
Сортировка
От Wang, Shenhao
Тема errors when there is a bit literal in ecpg
Дата
Msg-id d6402f1bacb74ecba22ef715dbba17fd@G08CNEXMBPEKD06.g08.fujitsu.local
обсуждение исходный текст
Ответы Re: errors when there is a bit literal in ecpg
Список pgsql-hackers
Hi, hacker

I met an error as below when I use ecpg

a.pgc:5: ERROR: invalid bit string literal
a.pgc:5: ERROR: internal error: unreachable state; please report this to <pgsql-bugs@lists.postgresql.org>

the test source is attached.

After investigating the code, I think the process of pgc.l is:
Step 1:  <SQL>{xbstart},  addlitchar('b') is called, literalbuf contains a char 'b';
Step 2:  <xb>{xbinside},   the rest of char is added in literalbuf
Step 3:   <xqs>{other},    the    condition literalbuf[strspn(literalbuf, "01") + 1] != '\0'   will always be true;
error is occurred here

I try to fix this bug by deleting 'addlitchar('b');' from source I also add a test case to test all const str in ecpg.

The patch is also attached.

Best regards, Shenhao Wang



Вложения

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

Предыдущее
От: John Naylor
Дата:
Сообщение: Re: speed up unicode decomposition and recomposition
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: Support for NSS as a libpq TLS backend