Re: [WIP] RE: [HACKERS] DECLARE STATEMENT setting up a connectionin ECPG

Поиск
Список
Период
Сортировка
Искать
От
Ideriha, Takeshi
Тема
Re: [WIP] RE: [HACKERS] DECLARE STATEMENT setting up a connectionin ECPG
Дата
Msg-id
4E72940DA2BF16479384A86D54D0988A56598DBF@G01JPEXMBKW04
Ответ на
Список
Дерево обсуждения
RE: [HACKERS] [WIP] RE: DECLARE STATEMENT setting up a connectionin ECPG "Ideriha, Takeshi" <ideriha.takeshi@jp.fujitsu.com>

Hi

 

> By the way, I have been able to crash your patch when running the regression

> tests:

> (lldb) bt

> * thread #1: tid = 0x0000, 0x00007fff89a828b0

> libsystem_platform.dylib`_platform_strcmp + 176, stop reason = signal SIGSTOP

>   * frame #0: 0x00007fff89a828b0 libsystem_platform.dylib`_platform_strcmp +

> 176

>     frame #1: 0x000000010c835bc3

> libecpg.6.dylib`ecpg_release_declared_statement(connection_name="con3")

> + 83 at prepare.c:740

>     frame #2: 0x000000010c838103

> libecpg.6.dylib`ECPGdisconnect(lineno=81, connection_name="ALL") + 179 at

> connect.c:697

>     frame #3: 0x000000010c811922 declare`main(argc=1,

> argv=0x00007fff533ee320) + 434 at declare.pgc:81

>     frame #4: 0x00007fff932345ad libdyld.dylib`start + 1

>

> You also need to add in src/interfaces/ecpg/test/sql/.gitignore new entries

> related to the files you are adding and that get generated.

 

Thank you very much for your test. I fixed this memory leak bug, and fixed .gitignore.

 

I also fixed some code style to fit coding conventions,

and splited my patch into 4 parts to improve readability:

* 001_declareStmt_preproc_v3.patch

* 002_declareStmt_ecpglib_v3.patch

* 003_declareStmt_doc_v3.patch

* 004_declareStmt_test_v3.patch

 

Here is a short summary:

[001_declareStmt_preproc_v3.patch]

This enables ecpg to pre-process "DECLARE prepared_name STATEMENT".

prepared_name is buffered to g_declared_list to check duplication of prepared_name.

After pre-processed, "DECLARE STATEMENT" is translated to ECPGdeclare().

And CUSRSOR STAETEMENT such as OPEN/FETCH/CLOSE cursor is translated into ECPGopen()/ECPGfetch()/ECPGclose().

These new function is defined at 002_declareStmt_ecpglib_v3.patch.

 

[002_declareStmt_ecpglib_v3.patch]

This patch mainly implements ECPGdeclare(), ECPGopen(), ECPGfetch(), ECPGclose().

ECPGdeclare() links the declared name and connection name.

 

Handling CURSOR things are originally done by ECPGdo().

But in order to handle connection linked to declared name,

the functions such as ECPGopen(), ECPGfetch()and ECPGclose() are introduced and these functions wraps ecpg_do().

 

[003_declareStmt_doc_v3.patch]

Docs. I wrote the DECLARE STATEMENT itself.

And added another example to ecpg-set-connection.

 

[004_declareStmt_test_v3.patch]

Regression test and answers.

I made them but I'm thinking these include too much test cases, don't they?

So I'm planning to make it smaller.

 

regards,

Ideriha Takeshi

В списке pgsql-hackers по дате отправления
От: Okano, Naoki
Дата:
От: Yugo Nagata
Дата:
FAQ