-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
\0 interpreted wrongly in cursor range (nodejs). #334
Comments
Which version of indexeddbshim are you using? |
I reproduced it with the latest (4.1.0) using both node v8 and node v9. |
Good find, thanks... Unfortunately, SQLite (at least the implementation we are using) does not work with NUL bytes (see https://github.com/mapbox/node-sqlite3/wiki/API#databaseexecsql-callback ). I wonder if https://github.com/JoshuaWise/better-sqlite3/ -- which I've been looking at using for the sake of synchronicity which can help us better mimic transaction timing -- might not have this limitation. (We still need some escaping for other purposes, however.) I suppose our escaping of NUL bytes could instead could begin with PR's welcome, as this would not be at the top of my priority list (and I'm low on energy and time these days)... |
@brettz9 Thanks for the response! I worked around the issue, so this isn't at the top of my priority list either. So definitely feel free to deprioritize (maybe revisit if/when you switch to better-sqlite3). |
I attempted to iterate all objects where the first element of the composite key is 'Johnson' by using the following index range (using 'Johnson\0' as the first entry that shouldn't match):
This works as expected using native IndexedDb in a browser, but with indexeddbshim in node.js I get results like 'Johnson2 ...' that should be out of range. Based on the results I get, I think '\0' is being treated as '\...' or something (i.e. as a backslash instead of as a null character).
Repro code:
Result with native IndexedDb on Chrome, Firefox, and Safari:
Result with indexedDb in node:
The last two entries shouldn't be there.
The text was updated successfully, but these errors were encountered: