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

rowOffset and rowLimit #45

Closed
fpolowood opened this issue Mar 17, 2021 · 2 comments · Fixed by #46
Closed

rowOffset and rowLimit #45

fpolowood opened this issue Mar 17, 2021 · 2 comments · Fixed by #46
Labels
bug Something isn't working

Comments

@fpolowood
Copy link

I am reading a table with 9855 records. I want to read 1000 at a time.
If I pass rowOffset:0, rowLimit:1000 I get 1000 records, if I pass rowOffset 1000, rowLimit: 1000 I get 0(zero) records

table.name:Products, table.rowCount:9855
table.getData({rowOffset:0,rowLimit:1000});
returned: 1000 records
table.getData({rowOffset:1000,rowLimit:1000});
returned: 0 records

and if I pass rowOffset 1000, rowLimit: 2000 it trows an error. So, I am not sure how it is supposed to work.

table.name:Products, table.rowCount:9855
table.getData({rowOffset:0,rowLimit:1000});
returned: 1000 records
table.getData({rowOffset:1000,rowLimit:2000});
(node:20761) UnhandledPromiseRejectionWarning: RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 4094. Received 6400
    at boundsError (internal/buffer.js:81:9)
    at Buffer.readUInt16LE (internal/buffer.js:238:5)
    at Buffer.readUIntLE (internal/buffer.js:175:17)
    at D.getDataFromPage (/Users/fpw/Projects/migrandama/mystore/mdbImport2/node_modules/mdb-reader/lib/index.js:1:10704)
    at D.getData (/Users/fpw/Projects/migrandama/mystore/mdbImport2/node_modules/mdb-reader/lib/index.js:1:10030)
@andipaetzold
Copy link
Owner

Hey @fpolowood,

Thanks for the error report! I just had a quick look and there seems to be a bug when using rowOffset and rowLimit.
I'll update this thread when I resolved the issue and published a new version of the package.

@andipaetzold andipaetzold added the bug Something isn't working label Mar 17, 2021
@andipaetzold
Copy link
Owner

I just released a new version (0.1.5) that should resolve the bug.

Please upgrade and check whether your code now runs correctly. If the error still exists, just reopen the ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants