Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

KB5026717 - Cumulative Update 4 for SQL Server 2022

Release Date:   May 11, 2023
Version:   16.0.4035.4

Summary

This article describes Cumulative Update package 4 (CU4) for Microsoft SQL Server 2022. This update contains 21 fixes that were issued after the release of SQL Server 2022 Cumulative Update 3, and it updates components in the following builds:

  • SQL Server - Product version: 16.0.4035.4, file version: 2022.160.4035.4
  • Analysis Services - Product version: 16.0.43.211, file version: 2022.160.43.211

Known issues in this update

Issue one

After you install this cumulative update, external data sources using the generic ODBC connector may no longer work. When you try to query external tables that were created before installing this cumulative update, you receive the following error message:

Msg 7320, Level 16, State 110, Line 68
Cannot execute the query "Remote Query" against OLE DB provider "MSOLEDBSQL" for linked server "(null)". Object reference not set to an instance of an object.

If you try to create a new external table, you receive the following error message:

Msg 110813, Level 16, State 1, Line 64
Object reference not set to an instance of an object.

To work around this issue, you can uninstall this cumulative update or add the Driver keyword to the CONNECTION_OPTIONS argument. For more information, see Generic ODBC external data sources may not work after installing Cumulative Update.

This issue is fixed in SQL Server 2022 CU5.

Issue two

After you install this cumulative update, you may receive incorrect results from queries that meet all of the following conditions:

  1. You have indexes that explicitly specify a descending sort order. Here's an example:

    CREATE NONCLUSTERED INDEX [nci_table_column1] ON [dbo].[table1] (column1 DESC)
    
  2. You run queries against tables that contain these indexes. These queries specify a sort order that matches the sort order of the indexes.

  3. The sort column is used in query predicates in the WHERE IN clause or multiple equality clauses. Here's an example:

    SELECT * FROM [dbo].[table1] WHERE column1 IN (1,2) ORDER BY column1 DESC
    SELECT * FROM [dbo].[table1] WHERE column1 = 1 or column1 = 2 ORDER BY column1 DESC
    

    Note

    The IN clause that has a single value doesn't have this issue.

To work around this issue, you can either uninstall this cumulative update or enable trace flag (TF) 13166 and then run DBCC FREEPROCCACHE.

This issue is fixed in SQL Server 2022 CU5.

Issue three

Queries that use the built-in SESSION_CONTEXT function might return incorrect results or trigger access violation (AV) dump files when run in parallel query plans. This issue occurs because of the manner in which SESSION_CONTEXT interacts with parallel execution threads, particularly if the session is reset for reuse.

For more information, see the Known issues section in SESSION_CONTEXT.

Improvements and fixes included in this update

A downloadable Excel workbook that contains a summary list of builds, together with their current support lifecycle, is available. The Excel file also contains detailed fix lists for SQL Server 2022, SQL Server 2019, and SQL Server 2017. Select to download this Excel file now.

Note

Individual entries in the following table can be referenced directly through a bookmark. If you select any bug reference ID in the table, a bookmark tag is added to the URL by using the "#NNNNNNN" format. You can then share this URL with others so that they can jump directly to the desired fix in the table.

For more information about the bugs that are fixed and enhancements that are included in this cumulative update, see the following Microsoft Knowledge Base articles.

Bug reference Description Fix area Component Platform
2305079 Fixes a DateTime issue where the month and day are incorrectly recognized in Master Data Services (MDS) that you encounter when the input format doesn't match the preset format. Master Data Services Master Data Services Windows
2300365 Fixes an access violation issue, most often seen on a database in an availability group, that you encounter during virtual device interface (VDI) backups. SQL Server Engine Backup Restore All
2299195 Fixes an issue where SQL Server Agent job steps fail with the following error after the management data warehouse (MDW) is configured on a server:

Executed as user: NT Service\SQLSERVERAGENT. SSIS error. Component name: GenerateTSQLPackageTask, Code: -1073548540, Subcomponent: Generate T-SQL Package Task, Description: An error occurred with the following error message: "The given key was not present in the dictionary.".   .  SSIS error. Component name: GenerateTSQLPackageTask, Code: -1073548540, Subcomponent: Generate T-SQL Package Task, Description: An error occurred with the following error message: "The given key was not present in the dictionary.".   .  The master package exited with error, previous error messages should explain the cause.  Process Exit Code 5.  The step failed.
SQL Server Engine Management Services All
2280423 FIX: Scalar UDF Inlining issues in SQL Server 2022 and 2019 (KB4538581) SQL Server Engine Query Execution All
2306513 Fixes access violations and INVALID_POINTER_READ_c0000005_sqlmin.dll!CProfileList::FGetPartitionSummaryXML exceptions that you may encounter during the execution of sys.dm_exec_query_plan_stats. SQL Server Engine Query Execution Windows
2306669 Fixes an issue where parameter sensitive plan (PSP) optimization produces a dispatcher expression but fails to create a query variant when an application attempts to use the SET FMTONLY ON T-SQL statement to return only metadata. SQL Server Engine Query Execution All
2310201 Fixes an issue where running the ALTER ASSEMBLY command for a complex common language runtime (CLR) assembly can cause some of the other commands that are executed in parallel to time out. SQL Server Engine Query Execution All
2329208 Fixes an issue where parameter sensitive plan (PSP) optimization can't successfully remove a query from the in-memory portion of the Query Store when PSP optimization has Query Store integration enabled. SQL Server Engine Query Execution All
2344871 Adds two new trace flags (TF) to the automatic plan correction (APC) feature of automatic tuning. TF 12618 introduces a new plan regression detection model that includes multiple consecutive checks. TF 12656 introduces the ability to use a time-based plan regression check that will occur five minutes after a plan change is discovered, which avoids biasing the regression checks by queries that execute quickly. SQL Server Engine Query Execution All
2344940 Fixes an access violation when parameter sensitive plan (PSP) optimization has Query Store integration enabled under certain conditions when query variants and dispatcher plans are being flushed from the in-memory portion of the Query Store data to disk. SQL Server Engine Query Execution All
2344943 Fixes an access violation when parameter sensitive plan (PSP) optimization has Query Store integration enabled when an inconsistent state exists within the PSP-related Query Store. An improvement has also been made to the sp_query_store_consistency_check stored procedure, which will fix query variant and dispatch plan consistency issues. SQL Server Engine Query Execution All
2344945 Fixes an issue when parameter sensitive plan (PSP) optimization has Query Store integration enabled when a dispatcher plan is removed from the Query Store. SQL Server Engine Query Execution All
2278800 Fixes an issue where incorrect results are returned when you use the LAG or LEAD window functions while using the IGNORE NULLS clause. SQL Server Engine Query Optimizer All
2297428 Fixes an issue where the KILL STATS JOB process leaks reference counts on some items when multiple asynchronous statistics jobs are running, which causes those items to remain in the queue (visible via sys.dm_exec_background_job_queue) until the SQL Server instance is restarted. SQL Server Engine Query Optimizer All
2307893 Fixes incorrect results for queries that filter on ROW_NUMBER and involve nullable columns. SQL Server Engine Query Optimizer All
2313621 Fixes the following errors and access violations that are caused by an incorrect plan in the case of multiple occurrences of the same scalar subquery:

Msg 596, Level 21, State 1, Line <LineNumber>
Cannot continue the execution because the session is in the kill state.
Msg 0, Level 20, State 0, Line <LineNumber>
A severe error occurred on the current command.  The results, if any, should be discarded.
SQL Server Engine Query Optimizer All
2343788 Fixes a memory leak issue in the Cardinality Estimation (CE) feedback when an OOM (Out of Memory) error occurs in a constructor function. SQL Server Engine Query Optimizer All
2303424 Fixes an issue that prevents you from dropping table groups on a database that has Azure Synapse Link enabled and the collation is set to Latin1_General_BIN2. SQL Server Engine Replication All
2335976 Fixes an issue where error 22836 occurs when you add the change data capture (CDC) job again after deleting CDC capture and removing a job in SQL Server Agent. SQL Server Engine Replication All
2312111 FIX: Errors occur after you apply a cumulative update to an instance of SQL Server that has a contained availability group (KB5027331) SQL Server Engine SQL Agent All
2329148 Fixes an issue where the SQL Server service on Linux exits with an unsuccessful code when you request to stop it. SQL Server Engine SQL Server Engine Linux

How to obtain or download this or the latest cumulative update package

File information

Notes for this update

How to uninstall this update

References


Feedback

Was this page helpful?

Additional resources