zillow / ctds

Python DB-API 2.0 library for MS SQL Server
MIT License
83 stars 12 forks source link

Bulk insert causes SQL Server crash under particular conditions #64

Closed senjaster closed 3 years ago

senjaster commented 4 years ago

The following conditions should be met:

  1. Use any database except tempdb
  2. Connect with autocommit = False
  3. Create an empty table with an index (and commit)
  4. Bulk insert into the table using tablock=True
  5. Do not commit
  6. Select something from the table If all above conditions are met, the SELECT causes unhandled exception with crash dump in SQL Server (tested on SQL Server 2017). Of course, the connection is getting dropped.

The script to reproduce the problem is attached: ctds_bulk_insert.zip

amachanic commented 3 years ago

I just tried this - no issue at all. Also, sounds like it is/was a SQL Server issue, not a cTDS issue.