You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: EXPORT_SET raises an internal error for an INT number_of_bits column #28210
EXPORT_SET() accepts an INT expression as its fifth number_of_bits argument during binding, then raises an internal type-assertion panic when the argument is a column:
ERROR 20101 (HY000): internal error: panic type mismatch: casting INT vector to []int64
...
pkg/sql/plan/function.ExportSet
pkg/sql/plan/function/func_binary.go:6018
Expected Behavior
All integer types accepted by the binder must execute normally. An INT column must not be read as an INT64 vector without a cast.
Steps to Reproduce
CREATETABLEexport_set_int_probe (
id INTPRIMARY KEY,
bits INT,
number_of_bits INT
);
INSERT INTO export_set_int_probe VALUES (1, 5, 4), (2, 10, 8);
SELECT id, EXPORT_SET(bits, 'Y', 'N', '-', number_of_bits)
FROM export_set_int_probe
ORDER BY id;
MySQL returns Y-N-Y-N and N-Y-N-Y-N-N-N-N. MatrixOne returns internal error 20101. The behavior was reproduced three times; the service remains available afterward.
Additional information
The type checker preserves the fifth argument's concrete integer type, but ExportSet unconditionally creates GenerateFunctionFixedTypeParameter[int64] for it.
Activity
fix(function): handle EXPORT_SET typed bit counts (#28731)
Ariznawlll commentedon Sep 12, 2026
已在最新官方 main
efb2c5084957ac90273a3f625668fc6a784562c4验证。EXPORT_SET(mask,...,number_of_bits)的number_of_bits来自 INT 列,不再触发内部错误。4/0/8分别稳定返回Y,N,Y,N、空串、8 个Y。issue_28210_28211_28392_28454_28456_28460_28461_functions;TestExportSetNumberOfBitsIntegerTypes当前 main 定向通过,MOTR 三轮复跑 12/12 case、252/252 statements 一致通过。测试通过。
fix(function): handle EXPORT_SET typed bit counts (matrixorigin#28731)
fix(function): handle EXPORT_SET typed bit counts (matrixorigin#28731)
fix(function): handle EXPORT_SET typed bit counts (matrixorigin#28731)