-
-
Notifications
You must be signed in to change notification settings - Fork 630
TypeError: value is out of bounds when Insert 1M rows from .sql file #248
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
Comments
was it accidentally reopened? |
i just set the here is my code: |
Related, when inserting (large) binary blobs I'm getting similar issues:
|
Thanks @lillem4n , going to start working on this now basically we need to support this: https://dev.mysql.com/doc/internals/en/sending-more-than-16mbyte.html |
@sidorares cool. As I see it this problem is split in two:
For me this broke the application since it did an unexpected exit. |
A quick and (kind of) dirty solution is to wrap quite a lot of code in try/catch. I'm laborating a little bit on that now. If you want I can do something that works and make a PR? |
feel free to suggest pr, but I'd rather add extra checks where required (for example, one source of problem here is me trying to store (buffer length >> 16) as byte value - which is out of range for length > 16m). So correct code here should 1) check for 3rd byte to be < 256 2) actually implement the way mysql handles big buffers On the other hand try/catch around user code ( callbacks ) are necessary |
Agreed, more sync checks on the right places is needed. Those could then throw errors catched by the try /catch wrapped around to callback gracefully. I'm going to fiddle around a bit now, then lets see if I fix something good enough for a PR. :) |
mysqljs/mysql related code to compare: |
Thanks! If you see any kind of unsafe code that input data (valid or malformed) could crash feel free to yell at me @lillem4n |
While looking around I see I've wrapped all code in a try/catch in my little db layer: https://github.com/larvit/larvitdb/blob/master/larvitdb.js and yet somehow this is circumvented by this error that simply crashes the application. That means client side try/catch is not enough. I will keep digging until I find a way to catch the errors. |
Ok, now I have a PR here: #419 that does two things:
My 2 cents is that this try / catch wrapping and the test should be there even when the actual issue is resolved to more gracefully catch other errors in the future. Please poke me if I do stuff wrong in your repo with the PR, so I can do better and actually help out next time. :) |
closing this ( big packet support in master, going to npm as 1.1.2 soon ) exception safety tracking issue is #419 |
any ideas?
The text was updated successfully, but these errors were encountered: