Skip to content
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

Insert into BLOB field fails #172

Closed
marktreble opened this issue Dec 11, 2018 · 3 comments
Closed

Insert into BLOB field fails #172

marktreble opened this issue Dec 11, 2018 · 3 comments
Labels

Comments

@marktreble
Copy link

Description/Steps to reproduce

Attempt to insert binary data into a BLOB column fails with 'Invalid Hex Value'
{
"USER_DEVICE_ID":20,
"SESSION_ID":"jQKCwhrnQgCGPqFn-LYwMiWWGTDBvnQi",
"SESSION_DATA":{"type":"Buffer","data":[97,98,99]},
"CREATED_DATE":"Mon Dec 10 2018 08:26:57",
"EXPIRY_DATE":"Mon Dec 10 2018 08:56:57"
}

Result

Fails with unexpected HEX Value

Additional information

I have fixed this on my local copy by modifying the code in oracle.js:

Oracle.prototype.toColumnValue = function(prop, val) {
    if (prop.type === Buffer) {
      return val;
    }

  .....

}

I found this code in the MySQL connector - which works!
Without this handler, the value gets serialized and therefore fails the insert.

Please add! Thanks.

@dhmlau
Copy link
Member

dhmlau commented Dec 13, 2018

@marktreble , since you have fixed this issue locally, are you interested in submitting a PR? And please add tests too. :) Thanks!

@stale
Copy link

stale bot commented Jul 11, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 11, 2019
@stale
Copy link

stale bot commented Jul 25, 2019

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants