Skip to content

Commit f3ed467

Browse files
committed
Return undefined for callTimeout with Oracle Client less than 18c
1 parent 46e6522 commit f3ed467

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/njsConnection.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2822,6 +2822,19 @@ NAN_GETTER(njsConnection::GetCallTimeout)
28222822
info.GetReturnValue().Set(Nan::Undefined());
28232823
return;
28242824
}
2825+
2826+
// if an Oracle Client less than 18.1 is being used, return undefined
2827+
dpiVersionInfo versionInfo;
2828+
dpiContext *context = njsOracledb::GetDPIContext();
2829+
if (dpiContext_getClientVersion(context, &versionInfo) < 0) {
2830+
njsOracledb::ThrowDPIError();
2831+
return;
2832+
}
2833+
if (versionInfo.versionNum < 18) {
2834+
info.GetReturnValue().Set(Nan::Undefined());
2835+
return;
2836+
}
2837+
28252838
if (dpiConn_getCallTimeout(connection->dpiConnHandle, &callTimeout) < 0) {
28262839
njsOracledb::ThrowDPIError();
28272840
return;

0 commit comments

Comments
 (0)