FIX: Access violation occurs when MSTVF references an In-Memory OLTP large-value data type with interleaved execution enabled in SQL Server 2019

Applies to: SQL Server 2019 on Windows

Symptoms


Consider the following scenario:
  • You have Cumulative Update 2 for SQL Server 2019 or later installed. 
  • There is a multi-statement table valued function (MSTVF) that references large-value data type columns from an In-Memory OLTP table.
  • The MSTVF is queried in the context of database compatibility level 140 or higher.
  • The database scoped configuration INTERLEAVED_EXECUTION_TVF is ON and the query is not using the DISABLE_INTERLEAVED_EXECUTION_TVF query hint.
In this scenario, an access violation occurs, and you mayreceive an error message that resembles the following:

SQL query fails with fatal error.
Msg 233, Level 20, State 0, Line LineNumber
A transport-level error has occurred when receiving resultsfrom the server.

Additionally, an error message is logged in the SQL Servererror log.

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. 

Resolution


This issue is fixed in the following cumulative update for SQL Server:
About cumulative updates for SQL Server:
Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

References


Learn about the terminology that Microsoft uses to describe software updates.