oracle / node-oracledb

Oracle Database driver for Node.js maintained by Oracle Corp.
http://oracle.github.io/node-oracledb/
Other
2.25k stars 1.07k forks source link

Fixed AUTH_TERMINAL value #1662

Closed sosoba closed 5 months ago

sosoba commented 5 months ago

https://github.com/oracle/node-oracledb/blob/afb9f696ca7dbdd72150ba5efdc94f3ebffb4133/lib/thin/protocol/messages/auth.js#L184C1-L188C53

There is a little bug.

buf.writeKeyValue("AUTH_TERMINAL", "unknown");

should be:

buf.writeKeyValue("AUTH_TERMINAL",cInfo.terminal);

Best regards.

sharadraju commented 5 months ago

Thanks @sosoba . Can you give a use case as to how you encountered this issue.

Will be useful for fixing this issue and other potential bugs.

sosoba commented 5 months ago

as a database administrator, we want to see a real description of the client to identify the source of performance problems or deadlocks. Ex.

select program, machine, terminal from gv$session;
program machine terminal
node.exe 8fb0a0e15c19 unknown

may look like:

import { CLIENT_INFO } from 'oracledb/lib/thin/util.js';

CLIENT_INFO.program = 'Ice cream maker'; // Describe real program name
CLIENT_INFO.hostName = `${process.env.DOCKER_HOST}/${CLIENT_INFO.hostName}`; // Add host hostname to container hostname
CLIENT_INFO.terminal = 'Station 2'; // Business instalation name
program machine terminal
Ice cream maker pc-foo-2/8fb0a0e15c19 Station 2

Setup NLS attributes on CLIENT_INFO are uggly but works. It would be best became getConnection parameters.

sharadraju commented 5 months ago

This is fixed in the 6.5.0 release. @sosoba Please verify