-
Notifications
You must be signed in to change notification settings - Fork 439
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
Getting RangeError [ERR_OUT_OF_RANGE] for "smalldatetime" type column while using bulk insert #1592
Comments
Hi @kartikgupta2607, we'll try to get the fix merged soon |
Hey @mShan0, a similar error was also reported for the following data type (also verified the same on my setup)
Can you also please check on the above issues? Ideally we should be having range validation for all datatypes |
Hi @mShan0 @arthurschreiber @MichaelSun90 Any updates on the above request? |
Hi @kartikgupta2607 , we are working on a change to add range checks for datatypes. Will gather the changes into a PR soon. |
Hi @MichaelSun90, any update on the changes? |
Hi @kartikgupta2607, we have raised a PR #1594 which should handle this error better. If you want, you can give it a try, and see if it behaves as expected. Meanwhile, we will working on merging it into master as soon as possible. |
The fix #1594 has been merged into the master branch. |
Thanks @MichaelSun90! |
Hi @MichaelSun90, tested the changes for other data types, its still failing for decimal and numeric type columns. There's an existing issue also for the same - #474 |
Hi @kartikgupta2607 , we were looking into all the datatype, and due to some JavaScript side shortage for handling numeric type, we just fixed the these types: date,datetime,datetime2,smalldatetime,datetimeoffset,money,Int,SmallInt,TinyInt. We are also discussing a solution for better handling the numeric types. |
Software versions
Additional Libraries Used and Versions
N/A
Table schema
Columns - id (char 100), smalldatetime (smalldatetime)
Connection configuration
{ authentication: { type: 'default', options: { userName: '***', password: '***' } }, server: 'ms-sql-sql-server-2017.***.amazonaws.com', options: { database: 'MsSQL_Restart', encrypt: true, port: 1433, requestTimeout: 100000, trustServerCertificate: true } }
Problem description
I am trying to bulk insert data in MsSQL using bulkLoad. The destination column contains smalldatetime column, and in insert data if we have value outside the allowed range, it crashes the server while inserting the value in buffer here. I've attached a sample script to replicate the behaviour
temp.txt
Expected behavior
Ideally, the range for any column type should be validated before-hand and respective error should be returned.
Actual behavior
Node internals throw error, thus crashing the server
Error message/stack trace
Any other details that can be helpful
There's an existing issue which hasn't been resolved yet - #1265
The text was updated successfully, but these errors were encountered: