matrixorigin / matrixone

Hyperconverged cloud-edge native database
https://docs.matrixorigin.cn/en
Apache License 2.0
1.79k stars 276 forks source link

[Bug]: panic of operator.And #3368

Closed yingfeng closed 2 years ago

yingfeng commented 2 years ago

Is there an existing issue for the same bug?

Environment

- Version or commit-id (e.g. v0.1.0 or 8b23a93):f61b51cf48af4226fd4afba26f03e8817f382654
- Hardware parameters:
- OS type:
- Others:

Actual Behavior

panic1:

[ERROR]
[SCRIPT   FILE]: cases/expression/case_when.sql
[ROW    NUMBER]: 125
[SQL STATEMENT]: SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END;
[EXPECT RESULT]:
1
1
1
1
1
[ACTUAL RESULT]:
Internal error: panic unexpected parameter types were received: goroutine 3647 [running]:
runtime/debug.Stack()
    /opt/hostedtoolcache/go/1.18.3/x64/src/runtime/debug/stack.go:24 +0x65
github.com/matrixorigin/matrixone/pkg/common/moerr.NewPanicError({0x2c36a20?, 0x335dba0})
    /home/runner/work/matrixone/matrixone/head/pkg/common/moerr/error.go:91 +0x53
github.com/matrixorigin/matrixone/pkg/vm/overload.Run.func1()
    /home/runner/work/matrixone/matrixone/head/pkg/vm/overload/run.go:50 +0x31
panic({0x2c36a20, 0x335dba0})
    /opt/hostedtoolcache/go/1.18.3/x64/src/runtime/panic.go:838 +0x207
github.com/matrixorigin/matrixone/pkg/container/vector.MustTCols[...](...)
    /home/runner/work/matrixone/matrixone/head/pkg/container/vector/tools.go:38
github.com/matrixorigin/matrixone/pkg/sql/plan2/function/operator.And({0xc026bebac0?, 0x2?, 0x2?}, 0xc00142d718?)
    /home/runner/work/matrixone/matrixone/head/pkg/sql/plan2/function/operator/and.go:96 +0x7f8
github.com/matrixorigin/matrixone/pkg/sql/plan2/function.Function.VecFn({0x0, 0x0, 0x8, 0x4, {0xc00019bf5e, 0x2, 0x2}, 0xa, 0x30a4ea8, 0x30a4ca0, ...}, ...)
    /home/runner/work/matrixone/matrixone/head/pkg/sql/plan2/function/function.go:139 +0x2b
github.com/matrixorigin/matrixone/pkg/sql/colexec2.EvalExpr(0xc0267a51d0, 0xc026e056b0, 0xc026beb6f0?)
    /home/runner/work/matrixone/matrixone/head/pkg/sql/colexec2/expr_eval.go:156 +0x158b
github.com/matrixorigin/matrixone/pkg/sql/colexec2/restrict.Call(0xc026e056b0, {0x2bce1e0?, 0xc0259e9ff8?})
    /home/runner/work/matrixone/matrixone/head/pkg/sql/colexec2/restrict/restrict.go:46 +0xa7
github.com/matrixorigin/matrixone/pkg/vm/overload.Run({0xc0271b4ba0?, 0x4, 0x1?}, 0x1?)
    /home/runner/work/matrixone/matrixone/head/pkg/vm/overload/run.go:54 +0xee
github.com/matrixorigin/matrixone/pkg/vm/pipeline2.(*Pipeline).Run(0xc00142df20, {0x336c200, 0xc026e1fdc0}, 0xc026e056b0)
    /home/runner/work/matrixone/matrixone/head/pkg/vm/pipeline2/pipeline.go:78 +0x23a
github.com/matrixorigin/matrixone/pkg/sql/compile2.(*Scope).Run(0xc0267d1540?, {0x338adc0?, 0xc0000101d0?})
    /home/runner/work/matrixone/matrixone/head/pkg/sql/compile2/scope.go:308 +0xc5
github.com/matrixorigin/matrixone/pkg/sql/compile2.(*Scope).MergeRun.func1(0xc0007d97b8?)
    /home/runner/work/matrixone/matrixone/head/pkg/sql/compile2/scope.go:326 +0x79
created by github.com/matrixorigin/matrixone/pkg/sql/compile2.(*Scope).MergeRun
    /home/runner/work/matrixone/matrixone/head/pkg/sql/compile2/scope.go:321 +0x1ad

panic2:

[ERROR]
[SCRIPT   FILE]: cases/operator/is_operator.sql
[ROW    NUMBER]: 185
[SQL STATEMENT]: SELECT * FROM t2 LEFT JOIN t2 AS t2_2 ON 1 WHERE t2_2.a IS not NULL;
[EXPECT RESULT]:
a   b   a   b
1999-05-10 00:01:01 1   1999-05-10 00:00:00 2
1999-05-10 00:01:01 1   1999-05-10 00:01:01 1
1999-05-10 00:00:00 2   1999-05-10 00:00:00 2
1999-05-10 00:00:00 2   1999-05-10 00:01:01 1
[ACTUAL RESULT]:
Internal error: panic unexpected parameter types were received: goroutine 9221 [running]:
runtime/debug.Stack()
    /opt/hostedtoolcache/go/1.18.3/x64/src/runtime/debug/stack.go:24 +0x65
github.com/matrixorigin/matrixone/pkg/common/moerr.NewPanicError({0x2c36a20?, 0x335dba0})
    /home/runner/work/matrixone/matrixone/head/pkg/common/moerr/error.go:91 +0x53
github.com/matrixorigin/matrixone/pkg/vm/overload.Run.func1()
    /home/runner/work/matrixone/matrixone/head/pkg/vm/overload/run.go:50 +0x31
panic({0x2c36a20, 0x335dba0})
    /opt/hostedtoolcache/go/1.18.3/x64/src/runtime/panic.go:838 +0x207
github.com/matrixorigin/matrixone/pkg/container/vector.MustTCols[...](...)
    /home/runner/work/matrixone/matrixone/head/pkg/container/vector/tools.go:38
github.com/matrixorigin/matrixone/pkg/sql/plan2/function/operator.And({0xc0218d8160?, 0x2?, 0x2?}, 0x0?)
    /home/runner/work/matrixone/matrixone/head/pkg/sql/plan2/function/operator/and.go:96 +0x7f8
github.com/matrixorigin/matrixone/pkg/sql/plan2/function.Function.VecFn({0x0, 0x0, 0x8, 0x4, {0xc00019bf5e, 0x2, 0x2}, 0xa, 0x30a4ea8, 0x30a4ca0, ...}, ...)
    /home/runner/work/matrixone/matrixone/head/pkg/sql/plan2/function/function.go:139 +0x2b
github.com/matrixorigin/matrixone/pkg/sql/colexec2.EvalExpr(0xc0246163c0, 0xc02251ec60, 0xc0211cd0e0?)
    /home/runner/work/matrixone/matrixone/head/pkg/sql/colexec2/expr_eval.go:156 +0x158b
github.com/matrixorigin/matrixone/pkg/sql/colexec2/restrict.Call(0xc02251ec60, {0x2bce1e0?, 0xc01dd74f38?})
    /home/runner/work/matrixone/matrixone/head/pkg/sql/colexec2/restrict/restrict.go:46 +0xa7
github.com/matrixorigin/matrixone/pkg/vm/overload.Run({0xc02b930cc0?, 0x3, 0x2?}, 0x2?)
    /home/runner/work/matrixone/matrixone/head/pkg/vm/overload/run.go:54 +0xee
github.com/matrixorigin/matrixone/pkg/vm/pipeline2.(*Pipeline).Run(0xc005e07f20, {0x336c200, 0xc02617f730}, 0xc02251ec60)
    /home/runner/work/matrixone/matrixone/head/pkg/vm/pipeline2/pipeline.go:78 +0x23a
github.com/matrixorigin/matrixone/pkg/sql/compile2.(*Scope).Run(0xc022d50e60?, {0x338adc0?, 0xc0000101d0?})
    /home/runner/work/matrixone/matrixone/head/pkg/sql/compile2/scope.go:308 +0xc5
github.com/matrixorigin/matrixone/pkg/sql/compile2.(*Scope).MergeRun.func1(0xc0001885b0?)
    /home/runner/work/matrixone/matrixone/head/pkg/sql/compile2/scope.go:326 +0x79
created by github.com/matrixorigin/matrixone/pkg/sql/compile2.(*Scope).MergeRun
    /home/runner/work/matrixone/matrixone/head/pkg/sql/compile2/scope.go:321 +0x1ad

panic3(similar with panic2):

[ERROR]
[SCRIPT   FILE]: cases/operator/is_operator.sql
[ROW    NUMBER]: 189
[SQL STATEMENT]: SELECT * FROM t2 JOIN t2 AS t2_2 ON 1 WHERE t2_2.a IS not NULL;
[EXPECT RESULT]:
a   b   a   b
1999-05-10 00:00:00 2   1999-05-10 00:01:01 1
1999-05-10 00:01:01 1   1999-05-10 00:01:01 1
1999-05-10 00:00:00 2   1999-05-10 00:00:00 2
1999-05-10 00:01:01 1   1999-05-10 00:00:00 2
[ACTUAL RESULT]:
Internal error: panic unexpected parameter types were received: goroutine 9241 [running]:
runtime/debug.Stack()
    /opt/hostedtoolcache/go/1.18.3/x64/src/runtime/debug/stack.go:24 +0x65
github.com/matrixorigin/matrixone/pkg/common/moerr.NewPanicError({0x2c36a20?, 0x335dba0})
    /home/runner/work/matrixone/matrixone/head/pkg/common/moerr/error.go:91 +0x53
github.com/matrixorigin/matrixone/pkg/vm/overload.Run.func1()
    /home/runner/work/matrixone/matrixone/head/pkg/vm/overload/run.go:50 +0x31
panic({0x2c36a20, 0x335dba0})
    /opt/hostedtoolcache/go/1.18.3/x64/src/runtime/panic.go:838 +0x207
github.com/matrixorigin/matrixone/pkg/container/vector.MustTCols[...](...)
    /home/runner/work/matrixone/matrixone/head/pkg/container/vector/tools.go:38
github.com/matrixorigin/matrixone/pkg/sql/plan2/function/operator.And({0xc0218d9340?, 0x2?, 0x2?}, 0x0?)
    /home/runner/work/matrixone/matrixone/head/pkg/sql/plan2/function/operator/and.go:96 +0x7f8
github.com/matrixorigin/matrixone/pkg/sql/plan2/function.Function.VecFn({0x0, 0x0, 0x8, 0x4, {0xc00019bf5e, 0x2, 0x2}, 0xa, 0x30a4ea8, 0x30a4ca0, ...}, ...)
    /home/runner/work/matrixone/matrixone/head/pkg/sql/plan2/function/function.go:139 +0x2b
github.com/matrixorigin/matrixone/pkg/sql/colexec2.EvalExpr(0xc024616690, 0xc022a2c630, 0xc0218d89f0?)
    /home/runner/work/matrixone/matrixone/head/pkg/sql/colexec2/expr_eval.go:156 +0x158b
github.com/matrixorigin/matrixone/pkg/sql/colexec2/restrict.Call(0xc022a2c630, {0x2bce1e0?, 0xc01dd754a8?})
    /home/runner/work/matrixone/matrixone/head/pkg/sql/colexec2/restrict/restrict.go:46 +0xa7
github.com/matrixorigin/matrixone/pkg/vm/overload.Run({0xc024877680?, 0x3, 0x2?}, 0x2?)
    /home/runner/work/matrixone/matrixone/head/pkg/vm/overload/run.go:54 +0xee
github.com/matrixorigin/matrixone/pkg/vm/pipeline2.(*Pipeline).Run(0xc005e07f20, {0x336c200, 0xc026754a10}, 0xc022a2c630)
    /home/runner/work/matrixone/matrixone/head/pkg/vm/pipeline2/pipeline.go:78 +0x23a
github.com/matrixorigin/matrixone/pkg/sql/compile2.(*Scope).Run(0xc0116792c0?, {0x338adc0?, 0xc0000101d0?})
    /home/runner/work/matrixone/matrixone/head/pkg/sql/compile2/scope.go:308 +0xc5
github.com/matrixorigin/matrixone/pkg/sql/compile2.(*Scope).MergeRun.func1(0x1d?)
    /home/runner/work/matrixone/matrixone/head/pkg/sql/compile2/scope.go:326 +0x79
created by github.com/matrixorigin/matrixone/pkg/sql/compile2.(*Scope).MergeRun
    /home/runner/work/matrixone/matrixone/head/pkg/sql/compile2/scope.go:321 +0x1ad

Expected Behavior

No response

Steps to Reproduce

No response

Additional information

No response

yingfeng commented 2 years ago

duplicate with part of #3298 duplicate with #3306