Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7c4d3fe

Browse files
committed
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 updatesecpg_log() to call ECPGget_sqlca() only when debug logging is enabled.Author: Yuto SasakiReviewed-by: Alvaro Herrera, Tom Lane, Fujii MasaoDiscussion:https://postgr.es/m/TY2PR01MB3628A85689649BABC9A1C6C3C1782@TY2PR01MB3628.jpnprd01.prod.outlook.com
1 parent53af949 commit7c4d3fe

File tree

1 file changed

+3
-1
lines changed
  • src/interfaces/ecpg/ecpglib

1 file changed

+3
-1
lines changed

‎src/interfaces/ecpg/ecpglib/misc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,10 @@ void
232232
ecpg_log(constchar*format,...)
233233
{
234234
va_listap;
235-
structsqlca_t*sqlca=ECPGget_sqlca();
236235
constchar*intl_format;
237236
intbufsize;
238237
char*fmt;
238+
structsqlca_t*sqlca;
239239

240240
/*
241241
* For performance reasons, inspect simple_debug without taking the mutex.
@@ -262,6 +262,8 @@ ecpg_log(const char *format,...)
262262
else
263263
snprintf(fmt,bufsize,"[%d]: %s", (int)getpid(),intl_format);
264264

265+
sqlca=ECPGget_sqlca();
266+
265267
pthread_mutex_lock(&debug_mutex);
266268

267269
/* Now that we hold the mutex, recheck simple_debug */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp