Skip to content

[Bug]: EXPORT_SET raises an internal error for an INT number_of_bits column #28210

Closed

Description

@Ariznawlll

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

e7bb0572235ec4bac81eb098eb0ad8900f0065ab

Other Environment Information

  • Local standalone MatrixOne; MySQL text protocol

Actual Behavior

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

CREATE TABLE export_set_int_probe (
  id INT PRIMARY 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

  1. added this to the MO-202609 milestone on Sep 5, 2026
  2. added
    kind/bug
    on Sep 5, 2026
  3. added theissue type on Sep 5, 2026
  4. self-assigned this
    on Sep 5, 2026
  5. added a commit that references this issue on Sep 11, 2026
    d191706
  6. Ariznawlll commented on Sep 12, 2026

    @Ariznawlll
    CollaboratorAuthor

    已在最新官方 main efb2c5084957ac90273a3f625668fc6a784562c4 验证。

    • 原始场景:EXPORT_SET(mask,...,number_of_bits) 的 number_of_bits 来自 INT 列,不再触发内部错误。
    • Happy path:INT 列 4/0/8 分别稳定返回 Y,N,Y,N、空串、8 个 Y。
    • 边界控制:0/负数和 65 上界均已覆盖,后续 select 证明 session 仍可用。
    • 自动化:已加入 MOTR PR (aoe)[daily-update]: correct the memory node size #165,issue_28210_28211_28392_28454_28456_28460_28461_functions;TestExportSetNumberOfBitsIntegerTypes 当前 main 定向通过,MOTR 三轮复跑 12/12 case、252/252 statements 一致通过。

    测试通过。

  7. added 3 commits that reference this issue on Sep 17, 2026
    e02e680
    ba172f7
    50d1b61
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bug

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions