Thread: 回复: Re: This may be a bug: odbc's function"check_client_encoding" have the same name with postgres's function.

Thanks very much.
We decide to use your solution1(20141029_pgodbc_rename_check_encoding.patch).
On the other hand, by the way, which solution does the community prefer to choose?

regards,
rohtodeveloper

--- 原始邮件 ---

发件人: "Inoue, Hiroshi" <inoue@tpf.co.jp>
已发: 2014年10月30日 上午11:00
收件人: "rohtodeveloper" <rohtodeveloper@outlook.com>
抄送: "Michael Paquier" <michael.paquier@gmail.com>, pgsql-odbc@postgresql.org
主题: Re: [ODBC] This may be a bug: odbc's function"check_client_encoding" have the same name with postgres's function.

(2014/10/29 18:02), Inoue, Hiroshi wrote:
> (2014/10/29 12:32), Inoue, Hiroshi wrote:
>> (2014/10/29 2:49), rohtodeveloper wrote:
>>> I'm so sorry, it seems that there was something wrong with the pictures
>>> in my last letter.
>>> Here I send the mail again with the correct pictures:
>>>
>>> Thanks a lot for your answer.
>>>
>>> Well ,in fact, if I use the extension called odbc_fdw , the same problem
>>> will happen.
>>>
>>> That’s because the odbc_fdw will also call the odbc driver.
>>>
>>> The follow pictures explain the situation.
>>>
>>> When use the odbc_fdw extension, the libraries are loaded in the
>>> following way.
>>>
>>> After all the libraries are loaded, When the function
>>> check_client_encoding is called , the whole postgres process will crash
>>> , result in a core dumped problem.
>>
>> Which check_client_encoding() call causes the crash?
>
> Oops I missed your anothe post.
> OK check_client_encoding() in the driver causes the crash.
> Currently all global symbols in the driver are exported.
> Exporting only ODBC APIs may solve the problem.

Possibly attached patch for Makefile.am fixes the problem.
Autoreconf, configure, make and make install are needed.
Could you try it?

regards,
Hiroshi Inoue

--
I am using the free version of SPAMfighter.
SPAMfighter has removed 12852 of my spam emails to date.
Get the free SPAMfighter here: http://www.spamfighter.com/len

Do you have a slow PC? Try a Free scan
http://www.spamfighter.com/SLOW-PCfighter?cid=sigen




On Mon, Nov 3, 2014 at 3:26 PM, developer rohto <rohtodeveloper@outlook.com> wrote:
Thanks very much.
We decide to use your solution1(20141029_pgodbc_rename_check_encoding.patch).
On the other hand, by the way, which solution does the community prefer to choose?
The potential solution by Inoue-san to reduce dependencies between library objects is better.
--
Michael
I think the solution2(symbols_conflict.patch) may not be able to solve the problem。 
The solution2 is trying to make the odbc’s check_client_encoding() function into a local function. 
However, the postgres's check_client_encoding() function is still a global function. 
When the odbc driver is trying to call the check_client_encoding() function, while the postgres's check_client_encoding() function is still being exposed , 

the postgres's check_client_encoding() may still have a chance to be called by the odbc driver ,and cause the postgres process to crash.


Date: Mon, 3 Nov 2014 15:52:06 +0900
Subject: Re: Re: [ODBC] This may be a bug: odbc's function"check_client_encoding" have the same name with postgres's function.
From: michael.paquier@gmail.com
To: rohtodeveloper@outlook.com
CC: inoue@tpf.co.jp; pgsql-odbc@postgresql.org



On Mon, Nov 3, 2014 at 3:26 PM, developer rohto <rohtodeveloper@outlook.com> wrote:
Thanks very much.
We decide to use your solution1(20141029_pgodbc_rename_check_encoding.patch).
On the other hand, by the way, which solution does the community prefer to choose?
The potential solution by Inoue-san to reduce dependencies between library objects is better.
--
Michael
Dear Michael, Inoue

Thanks very much.
Postgres process still crash  after solution2(symbols_conflict.patch) applied. 
So the other solution(solution1(20141029_pgodbc_rename_check_encoding.patch)) was perfered.
Right?

regards,
developer rohto

From: rohtodeveloper@outlook.com
To: michael.paquier@gmail.com
CC: inoue@tpf.co.jp; pgsql-odbc@postgresql.org
Subject: RE: [ODBC] This may be a bug: odbc's function"check_client_encoding" have the same name with postgres's function.
Date: Thu, 13 Nov 2014 07:09:50 +0000

I think the solution2(symbols_conflict.patch) may not be able to solve the problem。 
The solution2 is trying to make the odbc’s check_client_encoding() function into a local function. 
However, the postgres's check_client_encoding() function is still a global function. 
When the odbc driver is trying to call the check_client_encoding() function, while the postgres's check_client_encoding() function is still being exposed , 

the postgres's check_client_encoding() may still have a chance to be called by the odbc driver ,and cause the postgres process to crash.


Date: Mon, 3 Nov 2014 15:52:06 +0900
Subject: Re: Re: [ODBC] This may be a bug: odbc's function"check_client_encoding" have the same name with postgres's function.
From: michael.paquier@gmail.com
To: rohtodeveloper@outlook.com
CC: inoue@tpf.co.jp; pgsql-odbc@postgresql.org



On Mon, Nov 3, 2014 at 3:26 PM, developer rohto <rohtodeveloper@outlook.com> wrote:
Thanks very much.
We decide to use your solution1(20141029_pgodbc_rename_check_encoding.patch).
On the other hand, by the way, which solution does the community prefer to choose?
The potential solution by Inoue-san to reduce dependencies between library objects is better.
--
Michael