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

From: "Yuto Sasaki (Fujitsu)" <sasaki(dot)yuto-00(at)fujitsu(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: ECPG Refactor: move sqlca variable in ecpg_log()
Date: 2024-10-16 06:04:23
Message-ID: TY2PR01MB36289E9636CE55D18467CBF4C1462@TY2PR01MB3628.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>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. PSA a patch.

Best regards,

________________________________
差出人: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
送信日時: 2024年10月11日 1:13
宛先: Sasaki, Yuto/佐佐木 悠人 <sasaki(dot)yuto-00(at)fujitsu(dot)com>
CC: pgsql-hackers(at)lists(dot)postgresql(dot)org <pgsql-hackers(at)lists(dot)postgresql(dot)org>
件名: Re: ECPG Refactor: move sqlca variable in ecpg_log()

On 2024-Oct-10, Yuto Sasaki (Fujitsu) wrote:

> The sqlca variable in the ecpg_log() was declared with an unnecessarily wide
> scope, so I moved to the appropriate place.

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.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
Voy a acabar con todos los humanos / con los humanos yo acabaré
voy a acabar con todos (bis) / con todos los humanos acabaré ¡acabaré! (Bender)

Attachment Content-Type Size
change_scope.diff application/octet-stream 687 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-10-16 06:05:27 Re: UUID v7
Previous Message Soumyadeep Chakraborty 2024-10-16 06:04:16 Re: Syncrep and improving latency due to WAL throttling