-
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
The offset field of executeMany's result has just 16 bits #1157
Comments
It could be due to be a mismatch in types used between odpi-c layer and the NAN api in oracledb code. in ODPI-C offset is uint16_t in class dpiErrorInfo, while in lib, Nan::Newv8::Number, double... probably switching the type to v8:Uint16 might do the trick... |
ODPI-C currently has this value as 16-bit. It should probably be changed to 32-bit, but that will take a bit of effort in order to retain backwards compatibility. In the meantime, please use batches of less than 65536 entries! |
If it will get some time to fix, maybe a warning in the docs would help. I would put it in these two locations: |
… of 16-bit in order to allow for row offsets that exceed 65536. The original member has been renamed to offset16 in order to retain backwards compatibility (oracle/node-oracledb#1157).
I've pushed the necessary changes through to ODPI-C (on which node-oracledb depends). You can build node-oracledb yourself with the updated ODPI-C or wait for it to be included in the official release whenever that is made. |
@lmcarreiro the necessary ODPI-C change was picked up by node-oracledb 4.2, which is now available. Thanks for reporting the issue. |
With the async/await programming style, make sure you are using 'await' in the right places.
Ok
Is it an error or a hang or a crash?
Error
What error(s) you are seeing?
Created an array with 65538 elements, and forced an error to occur at the four last positions: 65534, 65535, 65536 and 65537. In the result, the first two is ok, 65534 and 65535. But the next two shoud be 65536 and 65537, not 0 and 1.
It is returning in the
offset
field just the 16 less meaning bits.Result of
console.log
:So, if I'm using
executeMany
with bigger arrays, I'll never be sure which input caused an error.Include a runnable Node.js script that shows the problem.
Include all SQL needed to create the database schema.
node script.js
Run node and show the output of:
The text was updated successfully, but these errors were encountered: