Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Summary
Any window function using a TEXT or BLOB column in PARTITION BY fails with:
ERROR 1815 (HY000): Internal error: WindowFunction::operator()
|
MCS-9019: Unknown column type encountered: '24'.
|
Type 24 = TEXT, type 15 = BLOB. VARCHAR and CHAR work correctly in the same position.
TEXT and BLOB are documented as supported data types since Columnstore 1.1.0.
Minimal Reproduction
CREATE TABLE t_text (id INT, txt TEXT) ENGINE=Columnstore; |
INSERT INTO t_text SELECT seq, CONCAT('text_', seq % 50) FROM seq_1_to_2000; |
|
|
-- Expected: works. Actual: ERROR 1815 MCS-9019
|
SELECT RANK() OVER (PARTITION BY txt ORDER BY id) FROM t_text; |
Also fails with:
- BLOB: Unknown column type encountered: '15'
- MEDIUMTEXT, LONGTEXT: type '24'
Works correctly:
- ORDER BY txt (without PARTITION BY) — OK
- PARTITION BY varchar_col — OK
InnoDB comparison
CREATE TABLE t_text_i (id INT, txt TEXT) ENGINE=InnoDB; |
INSERT INTO t_text_i VALUES (1,'aaa'),(2,'bbb'),(3,'aaa'),(4,'ccc'),(5,'bbb'); |
SELECT id, txt, RANK() OVER (PARTITION BY txt ORDER BY id) FROM t_text_i; |
-- Works correctly, returns proper ranks
|
Probable Root Cause
utils/windowfunction/idborderby.cpp, EqualCompData::operator() (line 807): the switch statement handles CHAR/VARCHAR via getStringField() but TEXT (24), BLOB (15), and VARBINARY (14) are missing. They fall through to default which throws IDBExcept(ERR_WF_UNKNOWN_COL_TYPE).
Fix: add case CalpontSystemCatalog::TEXT:, case CalpontSystemCatalog::BLOB:, case CalpontSystemCatalog::VARBINARY: to the CHAR/VARCHAR branch.
Version
MariaDB Columnstore 25.10.4 (stable-23.10)