zillow / ctds

Python DB-API 2.0 library for MS SQL Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bulk insert causes SQL Server crash under particular conditions

senjaster opened this issue · comments

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

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