tencent cloud

TencentDB for MySQL

ドキュメントTencentDB for MySQL

Window Function Collation Aggregation Failure Triggers Null Pointer Dereference Crash

Download
フォーカスモード
フォントサイズ
最終更新日: 2026-07-02 10:10:55
AI翻訳

Issue

In TencentDB for MySQL, when processing a Window Function query that uses a CASE expression in the ORDER BY clause, and when different branches of the CASE expression return fields with different collations, collation aggregation failure triggers a null pointer dereference, causing the database instance to Crash.

Issue Triggering Scenarios

Typical Triggering Conditions

1. Using window functions: The query contains window functions such as ROW_NUMBER(), RANK(), and DENSE_RANK().
2. ORDER BY contains a CASE expression: The ORDER BY clause of the window function uses a CASE WHEN...END expression.
3. Collation conflict: Different branches of the CASE expression return string-type fields with different collations.

Minimum Reproducible SQL

CREATE TABLE t1 (
id INT PRIMARY KEY,
col_ci VARCHAR(100) COLLATE utf8mb4_general_ci,
col_cs VARCHAR(100) COLLATE utf8mb4_unicode_ci
);

SELECT id, ROW_NUMBER() OVER (
ORDER BY CASE WHEN id = 1 THEN col_ci ELSE col_cs END
) AS rn FROM t1;

Affected Kernel Versions

Versions of MySQL 8.0 prior to 20260430.

Fixed Kernel Versions

MySQL 8.0 version 20260430 and later.

Fix

Upgrade to the fixed version.
Upgrade the kernel version to MySQL 8.0 version 20260430 or later. For the operation procedure, see Upgrading Kernel Minor Version.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック