Re: ECPG Refactor: move sqlca variable in ecpg_log()

Fujii Masao <masao.fujii@oss.nttdata.com>

From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: "Yuto Sasaki (Fujitsu)" <sasaki.yuto-00@fujitsu.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2024-10-18T05:45:41Z
Lists: pgsql-hackers

Attachments


On 2024/10/16 18:52, Fujii Masao wrote:
> 
> 
> On 2024/10/16 15:04, Yuto Sasaki (Fujitsu) wrote:
>>  >Hmm, I'm not sure we want that, because if we do this, then
>>  >ECPGget_sqlca() gets run with the debug_mutex held.  In the original
>>  >coding, it's run without the mutex.
>>
>> Thank you for pointing that out. I agree with your observation. But there is
>> another room for improvement - we can avoid unnecessary calls to ECPGget_sqlca()
>> by moving just before mutex lock.
> 
> +1
> 
>> PSA a patch.
> 
> The patch looks good to me.

I've attached the latest version of the patch, now including the commit log.
Unless there are any objections, I'll proceed with committing it.

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

Commits

  1. ecpg: Refactor ecpg_log() to skip unnecessary calls to ECPGget_sqlca().