-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fetchAsString raw type not supported in thin mode #1586
Labels
Comments
Thanks for the report. |
sharadraju
added a commit
that referenced
this issue
Aug 17, 2023
diff --git a/lib/impl/resultset.js b/lib/impl/resultset.js
index 3815e8e8..7d96a1f2 100644
--- a/lib/impl/resultset.js
+++ b/lib/impl/resultset.js
@@ -111,14 +111,17 @@ class ResultSetImpl {
if (metadata.dbType === types.DB_TYPE_NUMBER &&
metadata.fetchType === types.DB_TYPE_NUMBER) {
converter = (v) => (v === null) ? null : parseFloat(v);
- } else if (metadata.fetchType === types.DB_TYPE_VARCHAR &&
- (metadata.dbType === types.DB_TYPE_BINARY_DOUBLE ||
+ } else if (metadata.fetchType === types.DB_TYPE_VARCHAR) {
+ if (metadata.dbType === types.DB_TYPE_BINARY_DOUBLE ||
metadata.dbType === types.DB_TYPE_BINARY_FLOAT ||
metadata.dbType === types.DB_TYPE_DATE ||
metadata.dbType === types.DB_TYPE_TIMESTAMP ||
metadata.dbType === types.DB_TYPE_TIMESTAMP_LTZ ||
- metadata.dbType === types.DB_TYPE_TIMESTAMP_TZ)) {
- converter = (v) => (v === null) ? null : v.toString();
+ metadata.dbType === types.DB_TYPE_TIMESTAMP_TZ) {
+ converter = (v) => (v === null) ? null : v.toString();
+ } else if (metadata.dbType === types.DB_TYPE_RAW) {
+ converter = (v) => (v === null) ? null : v.toString('hex').toUpperCase();
+ }
}
if (userConverter && converter) {
const internalConverter = converter; The patch file for this issue has been uploaded in GitHub. This fix will be available as part of the 6.1 release |
This is now fixed in the 6.1 release. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ npm list|grep oracle
├── [email protected]
$ uname -a
Linux tnt-factory-ubuntu 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
................ node.js ........................
oracledb.fetchAsString = [oracledb.DB_TYPE_RAW];
,..
select saddr from v$session where rownum <= 1;
..
..............
thick mode
00000000690F5028 <--- fetch as string / good
thin mode
{"data": [0,0,0,0,105,15,80,40], "type": "Buffer"} -- not good
The text was updated successfully, but these errors were encountered: