ecpg: Refactor ecpg_log() to skip unnecessary calls to ECPGget_sqlca().
authorFujii Masao <fujii@postgresql.org>
Tue, 22 Oct 2024 14:56:37 +0000 (23:56 +0900)
committerFujii Masao <fujii@postgresql.org>
Tue, 22 Oct 2024 14:57:35 +0000 (23:57 +0900)
commit7c4d3fe272f3ab62b36f21e3fa6ae00751f00e31
tree98b6b709369fbf0ee33ac2a20c257c9e1d7128a6
parent53af9491a0439720094a11b72602952d79f59ac7
ecpg: Refactor ecpg_log() to skip unnecessary calls to ECPGget_sqlca().

Previously, ecpg_log() always called ECPGget_sqlca() to retrieve sqlca,
even though it was only needed for debug logging. This commit updates
ecpg_log() to call ECPGget_sqlca() only when debug logging is enabled.

Author: Yuto Sasaki
Reviewed-by: Alvaro Herrera, Tom Lane, Fujii Masao
Discussion: https://postgr.es/m/TY2PR01MB3628A85689649BABC9A1C6C3C1782@TY2PR01MB3628.jpnprd01.prod.outlook.com
src/interfaces/ecpg/ecpglib/misc.c