Re: BUG #12917: C program created by ecpg core dumped due to "varcharsize * offset"

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: BUG #12917: C program created by ecpg core dumped due to "varcharsize * offset"
Дата
Msg-id CAB7nPqT4fTkN5+fG08h2i_f308BsZdu8rWZnJQ+ET2m9rb6WVw@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #12917: C program created by ecpg core dumped due to “varcharsize * offset”  (chjischj@163.com)
Ответы Re: BUG #12917: C program created by ecpg core dumped due to "varcharsize * offset"  (chenhj <chjischj@163.com>)
Список pgsql-bugs
On Mon, Mar 30, 2015 at 8:13 PM, <chjischj@163.com> wrote:
>
> Table and data:
> create table empl(idnum integer, name char (10000000));
> insert into empl values(1,'abcdddd1123444ddffdfdffddfdfffd');

So the table used in your test uses char(10000000), which is a
datatype that completes with spaces strings stored that have a length
shorter than the limit. So even if you store a string of n characters,
what will be stored are those n characters, followed by 10,000,000 - n
spaces.

>
> EXEC SQL BEGIN DECLARE SECTION;
> struct TBempl
> {
>   long idnum;
>   char name[10000];
> };


And this test expects that result of column "name" does not contain
more 10k characters, so your data set is incompatible with your test,
explaining the crash you are seeing.
--
Michael

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: to high memory expensive xpath_table from xml2 contrib extension
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: PQexec() hangs on OOM