matrixorigin / matrixone

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

[Bug]: set @a_var=nextval reported panic error #8724

Closed heni02 closed 1 year ago

heni02 commented 1 year ago

Is there an existing issue for the same bug?

Environment

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

Actual Behavior

prepare stmt1 from 'insert into seq_table_01 values(?)'; set @a_var = nextval('seq15'); internal error: panic interface conversion: interface is nil, not engine.Engine: runtime.assertE2I /opt/homebrew/Cellar/go/1.19.3/libexec/src/runtime/iface.go:451 github.com/matrixorigin/matrixone/pkg/sql/plan/function/builtin/seq.Nextval /Users/heni/test-envir/matrixone/pkg/sql/plan/function/builtin/seq/nextval.go:40 github.com/matrixorigin/matrixone/pkg/sql/plan/function.Function.VecFn /Users/heni/test-envir/matrixone/pkg/sql/plan/function/function.go:177 github.com/matrixorigin/matrixone/pkg/sql/colexec.evalFunction /Users/heni/test-envir/matrixone/pkg/sql/colexec/expr_eval.go:484 github.com/matrixorigin/matrixone/pkg/sql/colexec.EvalExpr /Users/heni/test-envir/matrixone/pkg/sql/colexec/expr_eval.go:265 github.com/matrixorigin/matrixone/pkg/frontend.GetSimpleExprValue /Users/heni/test-envir/matrixone/pkg/frontend/util.go:286 github.com/matrixorigin/matrixone/pkg/frontend.doSetVar /Users/heni/test-envir/matrixone/pkg/frontend/mysql_cmd_executor.go:640 github.com/matrixorigin/matrixone/pkg/frontend.(MysqlCmdExecutor).handleSetVar /Users/heni/test-envir/matrixone/pkg/frontend/mysql_cmd_executor.go:679 github.com/matrixorigin/matrixone/pkg/frontend.(MysqlCmdExecutor).doComQuery /Users/heni/test-envir/matrixone/pkg/frontend/mysql_cmd_executor.go:2472 github.com/matrixorigin/matrixone/pkg/frontend.(MysqlCmdExecutor).ExecRequest /Users/heni/test-envir/matrixone/pkg/frontend/mysql_cmd_executor.go:3247 github.com/matrixorigin/matrixone/pkg/frontend.(Routine).handleRequest /Users/heni/test-envir/matrixone/pkg/frontend/routine.go:175 github.com/matrixorigin/matrixone/pkg/frontend.(RoutineManager).Handler /Users/heni/test-envir/matrixone/pkg/frontend/routine_manager.go:321 github.com/fagongzi/goetty/v2.(server).doConnection /Users/heni/go/pkg/mod/github.com/fagongzi/goetty/v2@v2.0.3-0.20221212132037-abf2d4c05484/application.go:381 github.com/fagongzi/goetty/v2.(*server).doStart.func2.1 /Users/heni/go/pkg/mod/github.com/fagongzi/goetty/v2@v2.0.3-0.20221212132037-abf2d4c05484/application.go:344 runtime.goexit /opt/homebrew/Cellar/go/1.19.3/libexec/src/runtime/asm_arm64.s:1172

Expected Behavior

No response

Steps to Reproduce

create table seq_table_01(col1 int);
create sequence seq15 increment 10 start with 20 no cycle;
prepare stmt1 from 'insert into seq_table_01 values(?)';
set @a_var = nextval('seq15');
execute stmt1 using @a_var;

Additional information

No response

zhangxu19830126 commented 1 year ago

Nextval function internal type detection needs to do nil judgment. @iceTTTT

iceTTTT commented 1 year ago

8732 is merged.

heni02 commented 1 year ago

confirm,closed commit id:7120770b819ec6ec000c2e4ffc0af24fa4c9043e image image

matrix-meow commented 1 year ago

Hello @heni02. The bug issue in the BVT test code has not been removed,issues automatically open.