Skip to content

[Bug]: internal error: panic unsafe slice cast: from length 8 is not enough for length 16 #23882

Closed

Description

@zhangxu19830126

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

612da2c

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

  1. 触发 panic 的 SQL
    来源:...q18...run0.json:378,错误事件在 ...run0.json:367

SELECT x.__mf_part_key AS customer_id,
x.__mf_cum_val AS second_cum_amount
FROM (
SELECT customer_id AS __mf_part_key,
ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date) AS __mf_rn,
SUM(amount) OVER (PARTITION BY customer_id ORDER BY order_date ROWS UNBOUNDED PRECEDING) AS __mf_cum_val
FROM orders
WHERE (YEAR(order_date)=2024)
) AS x
WHERE x.__mf_rn = 2;

  1. q18 对应表结构
    来源:nl2sql_q18_window_second_cum_amount.yaml:11

CREATE TABLE IF NOT EXISTS {{db}}.{{orders}} (
id INT AUTO_INCREMENT PRIMARY KEY,
customer_id INT,
order_date DATE,
amount DECIMAL(10,2)
);

Expected Behavior

No response

Steps to Reproduce

创建表,执行sql

Additional information

No response

Activity

  1. zhangxu19830126 commented on Mar 19, 2026

    @zhangxu19830126
    ContributorAuthor

    {"level":"ERROR","time":"2026/03/19 08:10:19.418354 +0800","name":"cn-service","caller":"frontend/util.go:465","msg":"query trace status","service":"dd1dccb4-4d3c-41f8-b482-5251dc7a41bf","uuid":"dd1dccb4-4d 3c-41f8-b482-5251dc7a41bf","statement":"SELECT x.__mf_part_key AS customer_id,\n x.__mf_cum_val AS second_cum_amount\nFROM (\n SELECT customer_id AS __mf_part_key,\n ROW_NUMBER() OV ER (PARTITION BY customer_id ORDER BY order_date) AS __mf_rn,\n SUM(amount) OVER (PARTITION BY customer_id ORDER BY order_date ROWS UNBOUNDED PRECEDING) AS __mf_cum_val\n FROM orders \n WHERE (YEAR(order_date)=2024)\n) AS x\nWHERE x.__mf_rn = 2","status":"fail","error":"internal error: panic unsafe slice cast: from length 8 is not enough for length 16: \ngithub.com/matrixorigin/ma trixone/pkg/common/util.UnsafeSliceCastToLength[...]\n\t/Users/zhangxu/Projects/go/matrixone/pkg/common/util/unsafe.go:89\ngithub.com/matrixorigin/matrixone/pkg/container/vector.toSliceOfLengthNoTypeCheck[. ..]\n\t/Users/zhangxu/Projects/go/matrixone/pkg/container/vector/vector.go:76\ngithub.com/matrixorigin/matrixone/pkg/container/vector.ToFixedCol[...]\n\t/Users/zhangxu/Projects/go/matrixone/pkg/container/ve ctor/tools.go:43\ngithub.com/matrixorigin/matrixone/pkg/container/vector.MustFixedColWithTypeCheck[...]\n\t/Users/zhangxu/Projects/go/matrixone/pkg/container/vector/tools.go:56\ngithub.com/matrixorigin/matr ixone/pkg/container/vector.GenerateFunctionFixedTypeParameter[...]\n\t/Users/zhangxu/Projects/go/matrixone/pkg/container/vector/functionTools.go:145\ngithub.com/matrixorigin/matrixone/pkg/sql/plan/function. valueDec128Compare\n\t/Users/zhangxu/Projects/go/matrixone/pkg/sql/plan/function/func_compare.go:596\ngithub.com/matrixorigin/matrixone/pkg/sql/plan/function.equalFn\n\t/Users/zhangxu/Projects/go/matrixone/ pkg/sql/plan/function/func_compare.go:384\ngithub.com/matrixorigin/matrixone/pkg/sql/colexec.(*FunctionExpressionExecutor).Eval\n\t/Users/zhangxu/Projects/go/matrixone/pkg/sql/colexec/evalExpression.go:633\ ngithub.com/matrixorigin/matrixone/pkg/sql/colexec/filter.(*Filter).Call\n\t/Users/zhangxu/Projects/go/matrixone/pkg/sql/colexec/filter/filter.go:93\ngithub.com/matrixorigin/matrixone/pkg/vm.Exec\n\t/Users/ zhangxu/Projects/go/matrixone/pkg/vm/types.go:358\ngithub.com/matrixorigin/matrixone/pkg/vm.ChildrenCall\n\t/Users/zhangxu/Projects/go/matrixone/pkg/vm/types.go:369\ngithub.com/matrixorigin/matrixone/pkg/sq l/colexec/projection.(*Projection).Call\n\t/Users/zhangxu/Projects/go/matrixone/pkg/sql/colexec/projection/projection.go:62\ngithub.com/matrixorigin/matrixone/pkg/vm.Exec\n\t/Users/zhangxu/Projects/go/matri xone/pkg/vm/types.go:358\ngithub.com/matrixorigin/matrixone/pkg/vm.ChildrenCall\n\t/Users/zhangxu/Projects/go/matrixone/pkg/vm/types.go:369\ngithub.com/matrixorigin/matrixone/pkg/sql/colexec/projection.(*Pr ojection).Call\n\t/Users/zhangxu/Projects/go/matrixone/pkg/sql/colexec/projection/projection.go:62\ngithub.com/matrixorigin/matrixone/pkg/vm.Exec\n\t/Users/zhangxu/Projects/go/matrixone/pkg/vm/types.go:358\ ngithub.com/matrixorigin/matrixone/pkg/vm.ChildrenCall\n\t/Users/zhangxu/Projects/go/matrixone/pkg/vm/types.go:369\ngithub.com/matrixorigin/matrixone/pkg/sql/colexec/output.(*Output).Call\n\t/Users/zhangxu/ Projects/go/matrixone/pkg/sql/colexec/output/output.go:58\ngithub.com/matrixorigin/matrixone/pkg/vm.Exec\n\t/Users/zhangxu/Projects/go/matrixone/pkg/vm/types.go:358\ngithub.com/matrixorigin/matrixone/pkg/vm /pipeline.(*Pipeline).Run\n\t/Users/zhangxu/Projects/go/matrixone/pkg/vm/pipeline/pipeline.go:71\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).Run\n\t/Users/zhangxu/Projects/go/matrixone/pkg/s ql/compile/scope.go:173\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).ParallelRun\n\t/Users/zhangxu/Projects/go/matrixone/pkg/sql/compile/scope.go:497\ngithub.com/matrixorigin/matrixone/pkg/sq l/compile.(*Scope).MergeRun\n\t/Users/zhangxu/Projects/go/matrixone/pkg/sql/compile/scope.go:350\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Compile).run\n\t/Users/zhangxu/Projects/go/matrixone/pkg /sql/compile/compile.go:339\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Compile).runOnce\n\t/Users/zhangxu/Projects/go/matrixone/pkg/sql/compile/compile.go:505\ngithub.com/matrixorigin/matrixone/pk g/sql/compile.(*Compile).Run\n\t/Users/zhangxu/Projects/go/matrixone/pkg/sql/compile/compile2.go:257\ngithub.com/matrixorigin/matrixone/pkg/frontend.executeResultRowStmt\n\t/Users/zhangxu/Projects/go/matrix one/pkg/frontend/result_row_stmt.go:87\ngithub.com/matrixorigin/matrixone/pkg/frontend.executeStmt\n\t/Users/zhangxu/Projects/go/matrixone/pkg/frontend/mysql_cmd_executor.go:3087\ngithub.com/matrixorigin/ma trixone/pkg/frontend.dispatchStmt\n\t/Users/zhangxu/Projects/go/matrixone/pkg/frontend/mysql_cmd_executor.go:2935\ngithub.com/matrixorigin/matrixone/pkg/frontend.executeStmtWithIncrStmt\n\t/Users/zhangxu/Pr ojects/go/matrixone/pkg/frontend/mysql_cmd_executor.go:2900\ngithub.com/matrixorigin/matrixone/pkg/frontend.executeStmtWithWorkspace\n\t/Users/zhangxu/Projects/go/matrixone/pkg/frontend/mysql_cmd_executor.g o:2844\ngithub.com/matrixorigin/matrixone/pkg/frontend.executeStmtWithTxn\n\t/Users/zhangxu/Projects/go/matrixone/pkg/frontend/mysql_cmd_executor.go:2719","txn_info":"70f70f4866a9b62a189d9272d34413a8:177387 9019407293000-1","session_info":"connectionId 12453|127.0.0.1:56843|account ws_50d29b12:global_shared_ws_owner_1773878697137636000|goRoutineId 1374663866048|migrate-goRoutineId 0|019d036d-7bee-7a65-bd03-253 898d97348","role":"accountadmin","session_id":"019d036d-7bee-7a65-bd03-253898d97348","statement_id":"019d036d-c791-7ceb-82e0-343f2aca4d6e","span":{"trace_id":"2df63d1c-bdc1-f6f5-2c15-21bd7a490524","span_id" :"be1e3ce17cd3fffe"}}

  2. changed the title [-][Bug]: panic[/-] [+][Bug]: internal error: panic unsafe slice cast: from length 8 is not enough for length 16[/+] on Mar 19, 2026
  3. Repository owner unassigned on Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s-1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions