8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 18:43:02 +01:00

Implement #8230: Ability to obtain PID of server process for current connection without querying mon$ tables

This commit is contained in:
Dmitry Yemanov 2024-10-29 20:39:30 +03:00
parent c4bc9432a4
commit 781e5d92f3

View File

@ -396,6 +396,7 @@ const char
CLIENT_VERSION_NAME[] = "CLIENT_VERSION", CLIENT_VERSION_NAME[] = "CLIENT_VERSION",
CURRENT_USER_NAME[] = "CURRENT_USER", CURRENT_USER_NAME[] = "CURRENT_USER",
CURRENT_ROLE_NAME[] = "CURRENT_ROLE", CURRENT_ROLE_NAME[] = "CURRENT_ROLE",
SERVER_PID_NAME[] = "SERVER_PID",
SESSION_IDLE_TIMEOUT[] = "SESSION_IDLE_TIMEOUT", SESSION_IDLE_TIMEOUT[] = "SESSION_IDLE_TIMEOUT",
STATEMENT_TIMEOUT[] = "STATEMENT_TIMEOUT", STATEMENT_TIMEOUT[] = "STATEMENT_TIMEOUT",
EFFECTIVE_USER_NAME[] = "EFFECTIVE_USER", EFFECTIVE_USER_NAME[] = "EFFECTIVE_USER",
@ -4709,6 +4710,8 @@ dsc* evlGetContext(thread_db* tdbb, const SysFunction*, const NestValueArray& ar
resultStr = role.c_str(); resultStr = role.c_str();
} }
else if (nameStr == SERVER_PID_NAME)
resultStr.printf("%d", getpid());
else if (nameStr == SESSION_IDLE_TIMEOUT) else if (nameStr == SESSION_IDLE_TIMEOUT)
resultStr.printf("%" ULONGFORMAT, attachment->getIdleTimeout()); resultStr.printf("%" ULONGFORMAT, attachment->getIdleTimeout());
else if (nameStr == STATEMENT_TIMEOUT) else if (nameStr == STATEMENT_TIMEOUT)