diff --git a/doc/sql.extensions/README.context_variables2 b/doc/sql.extensions/README.context_variables2 index fcb7901a59..12dfd100a7 100644 --- a/doc/sql.extensions/README.context_variables2 +++ b/doc/sql.extensions/README.context_variables2 @@ -54,12 +54,20 @@ Usage: Variable name Value ------------------------------------------------------------------------------ NETWORK_PROTOCOL | The network protocol used by client to connect. Currently - | used values: "TCPv4", "WNET", "XNET" and NULL + | used values: "TCPv4", "TCPv6", "WNET", "XNET" and NULL | - CLIENT_ADDRESS | The wire protocol address of remote client represented as - | string. Value is IP address in form "xxx.xxx.xxx.xxx" for - | TCPv4 protocol, local host name for XNET protocol and - | NULL for all other protocols + CLIENT_ADDRESS | The wire protocol address and port number of remote client + | represented as string. Value is IP address concatenated with + | port number using the '/' separator character. Value is + | returned for TCPv4 and TCPv6 protocols only, for all other + | protocols NULL is returned + | + CLIENT_HOST | The wire protocol host name of remote client. Value is + | returned for all supported protocols + | + CLIENT_PID | Process ID of remote client application + | + CLIENT_PROCESS | Process name of remote client application | DB_NAME | Canonical name of current database. It is either alias | name if connectivity via file names is not allowed or @@ -71,6 +79,11 @@ Usage: TRANSACTION_ID | Numeric ID for current transaction. Returned value is the | same as of CURRENT_TRANSACTION pseudo-variable | + LOCK_TIMEOUT | Lock timeout value specified for current transaction + | + READ_ONLY | Returns "TRUE" if current transaction is read-only and + | "FALSE" otherwise + | SESSION_ID | Numeric ID for current session. Returned value is the | same as of CURRENT_CONNECTION pseudo-variable | diff --git a/src/jrd/SysFunction.cpp b/src/jrd/SysFunction.cpp index ea4490f4d7..1d95df9224 100644 --- a/src/jrd/SysFunction.cpp +++ b/src/jrd/SysFunction.cpp @@ -210,6 +210,7 @@ const char SESSION_ID_NAME[] = "SESSION_ID", NETWORK_PROTOCOL_NAME[] = "NETWORK_PROTOCOL", CLIENT_ADDRESS_NAME[] = "CLIENT_ADDRESS", + CLIENT_HOST_NAME[] = "CLIENT_HOST", CLIENT_PID_NAME[] = "CLIENT_PID", CLIENT_PROCESS_NAME[] = "CLIENT_PROCESS", CURRENT_USER_NAME[] = "CURRENT_USER", @@ -2195,6 +2196,13 @@ dsc* evlGetContext(thread_db* tdbb, const SysFunction*, const NestValueArray& ar resultStr = attachment->att_remote_address; } + else if (nameStr == CLIENT_HOST_NAME) + { + if (attachment->att_remote_host.isEmpty()) + return NULL; + + resultStr = attachment->att_remote_host; + } else if (nameStr == CLIENT_PID_NAME) { if (!attachment->att_remote_pid)