Note

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

Access to this page requires authorization. You can try .

KB5036432 - Cumulative Update 13 for SQL Server 2022

Release Date:   May 16, 2024
Version:   16.0.4125.3

Summary

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

  • SQL Server - Product version: 16.0.4125.3, file version: 2022.160.4125.3
  • Analysis Services - Product version: 16.0.43.233, file version: 2022.160.43.233

Known issues in this update

Issue one: Patching error for secondary replicas in an availability group with databases enabled replication, CDC, or SSISDB

SQL Server 2022 CU13 introduced fix 2998350 to make secondary databases in an availability group (AG) startup more reliably. However, this fix causes a problem where AG databases don't start recovery if SQL Server is running in single-user mode. SQL Server Setup runs in single-user mode. As a result of this, if you run Setup and also have SQL replication or change data capture (CDC) enabled on a database in the AG, when the catalog upgrade scripts try to run but can't access the database, setup fails.

After SQL Server Setup initially fails, the SQL Server service then tries to come online again without single-user mode. At that time, the patch upgrade scripts finish successfully and patching is complete. Once startup completes, the issue is resolved and no user action is required.

The patch fails with the following error:

Error installing SQL Server Database Engine Services Instance Features
Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
Error code: 0x851A001A

When you check the SQL Server error log, you see a message with an invalid Group ID. To verify it's an invalid ID, look for previous startup records in the same log file for the problematic database name to compare:

Skipping the default startup of database <DatabaseName> because the database belongs to an availability group (Group ID: <GroupID>). The database will be started by the availability group. This is an informational message only. No user action is required.

If you want to prevent the patch from reporting an initial failure, you can perform one of the following actions before running the patch:

  • Enable Trace Flag 12347 - reverts the changes made in fix 2998350. You should remove this trace flag after patching.

  • Drop the CDC or replication enabled database from the AG.

  • Remove CDC or replication from the database in the AG.

This issue is fixed in SQL Server 2022 CU16.

Issue two: Incorrect behavior of SESSION_CONTEXT in parallel plans

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
2998350 Fixes an issue in which the secondary databases of an availability group might fail to be online intermittently. Additionally, you see the following error message:

Database 'DatabaseName' (database ID <IDNumber>) startup failed with error 3602, severity 25, state 145.
SQL Server Engine High Availability and Disaster Recovery All
3025790 Fixes an assertion failure (Location: HadrArProxy.cpp:4314; Expression: !CFeatureSwitchesMin::GetCurrentInstance()->FHadrCheckXClusterAgUcsSizeEnabled() || cbBlob < x_cbMsgBodyMax) that you might encounter when you use read-scale availability groups without a cluster configuration. SQL Server Engine High Availability and Disaster Recovery All
2984871 Fixes an issue in the lock manager that might cause random access violations and dumps on secondary replicas when the primary replica has 16 or more processors, and the secondary replicas have less than 16 processors. SQL Server Engine Metadata All
3084239 Fixes a latch time-out issue that you encounter when fetching the next value for sequence objects, which is due to self-deadlock during lock escalation. SQL Server Engine Metadata All
2916501 Adds a new advanced option 'max RPC request params (KB)' configured by using sp_configure to limit the maximum memory allocated for handling remote procedure call (RPC) request parameters. SQL Server Engine Query Execution All
2973934 Fixes an issue in which using the INSERT statement with the CAST or CONVERT function from a string representing negative zero to a decimal or numeric datatype succeeds, but you see the following error message on DBCC CHECKDB and DBCC CHECKTABLE:

Msg 2570, Level 16, State 3, Line <LineNumber>
Page (1:360), slot 0 in object ID <ObjectID>, index ID <IndexID>, partition ID <PartitionID>, alloc unit ID <UnitID> (type "In-row data"). Column "<ColumnName>" value is out of range for data type "decimal". Update column to a legal value.
SQL Server Engine Query Execution All
3102467 Caches the maximum number of histogram steps in a global configuration variable to reduce PREEMPTIVE_OS_REGISTRY waits when creating statistics on temporary tables. SQL Server Engine Query Optimizer All
2810754 FIX: Can't disable "change data capture" if any column is encrypted by "Always Encrypted" feature in SQL Server (KB4034376) SQL Server Engine Replication All
3003456 Fixes an issue in which some changes might not be captured into the change data capture (CDC) change tables (cdc.<capture_instance>_CT) when CDC runs in parallel with a switch partition operation. SQL Server Engine Replication All
3015714 Fixes the following error that you encounter when running sys.sp_flush_CT_internal_table_on_demand in a SQL Server instance that has the Case-sensitive (_CS) collation option:

Msg 137, Level 15, State 2, Procedure sp_ManualCTCleanup, Line <LineNumber> [Batch Start Line 3]
Must declare the scalar variable "@TableName".
Msg 137, Level 15, State 2, Procedure sp_ManualCTCleanup, Line <LineNumber> [Batch Start Line 3]
Must declare the scalar variable "@TableName".
Total rows deleted: (null).
Total rows deleted: (null).
SQL Server Engine Replication All
3033974 Adds the error message to the comments column of dbo.MSchange_tracking_history to help you understand the failure if a failure occurs during the auto cleanup or manual cleanup process. SQL Server Engine Replication All
3144736 Fixes an error that you encounter when using conversation timers in Service Broker while the SQL Server instance is under memory pressure. This causes queries to fail and the instance to stop responding. SQL Server Engine Replication Windows
3071580 Fixes an issue in which the full-text auto crawl function might stop working when you use full-text search. SQL Server Engine Search All
2979492 Fixes the following error that you encounter when updating a view with a linked server connection to another instance if dynamic data masking (DDM) is enabled:

Msg 15905, Level 16, State 6, Procedure <ProcedureName>, Line <LineNumber> [Batch Start Line 34]
Query not supported: Cannot determine result column sources.Invalid metadata.
SQL Server Engine Security Infrastructure All
3033535 Adds the following log message when high I/O latencies are detected in Bufferpool Lazy Writer (ntdll!ZwWriteFile system call) due to a performance issue in the underlying storage:

WARNING Long asynchronous API Call: The scheduling fairness of scheduler can be impacted by an asynchronous API invocation unexpectedly exceeding xxx ms.
SQL Server Engine SQL OS All

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