matrixorigin / matrixone

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

[Bug]: show indexes stmt error in non-sys account #7890

Closed aressu1985 closed 1 year ago

aressu1985 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):4410d8618193455fc0be25d3af17d19b5bbc1a0e
- Hardware parameters:
- OS type:
- Others:

Actual Behavior

sudong@sudongdeMacBook-Pro matrixone % mysql -h127.0.0.1 -utest:test -p111 -P6001 mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1817 Server version: 8.0.30-MatrixOne-v0.6.0 MatrixOne

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> mysql> mysql> use test; ERROR 1049 (HY000): invalid database test mysql> create databases; ERROR 1064 (HY000): SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 16 near " databases"; mysql> create database test; Query OK, 1 row affected (0.13 sec)

mysql> use test; Database changed mysql> drop table if exists t; Query OK, 0 rows affected (0.00 sec)

mysql> create table t( -> a int, -> b int, -> c int, -> primary key(a) -> ); Query OK, 0 rows affected (0.07 sec)

mysql> show indexes from t; ERROR 20101 (HY000): internal error: panic interface conversion: plan.isExpr_Expr is plan.Expr_F, not plan.Expr_C: runtime.panicdottypeE /usr/local/go/src/runtime/iface.go:262 runtime.panicdottypeI /usr/local/go/src/runtime/iface.go:272 github.com/matrixorigin/matrixone/pkg/sql/colexec.getConstVecInList /Users/sudong/Program/MatrixOrigin/matrixone/pkg/sql/colexec/expr_eval.go:67 github.com/matrixorigin/matrixone/pkg/sql/colexec.EvalExpr /Users/sudong/Program/MatrixOrigin/matrixone/pkg/sql/colexec/expr_eval.go:239

Expected Behavior

No response

Steps to Reproduce

1. create a account and connect mo with this account
2.run the following sqls:

drop table if exists t;
create table t(
                  a int,
                  b int,
                  c int,
                  primary key(a)
);
show indexes from t;

Additional information

No response

daviszhen commented 1 year ago

I have reproduced it. But it is strange. In sys account, there is no such panic. But in the general account, it happens.

nnsgmsone commented 1 year ago

I can't reproduce, probably fixed by Yuanning's recent pr. Can test again. @aressu1985

sukki37 commented 1 year ago

waiting for @ouyuanning's #7953 ,once merged please pass this to @aressu1985

daviszhen commented 1 year ago

waiting for @ouyuanning's #7953 ,once merged please pass this to @aressu1985

我的意思是这个IN的执行,不支持常量应该报错,而不是panic。而不是通过走optimizer 来避免错误

sukki37 commented 1 year ago

waiting for @ouyuanning's #7953, once merged please pass this to @aressu1985

我的意思是这个IN的执行,不支持常量应该报错,而不是panic。而不是通过走optimizer 来避免错误

File another issue?

aressu1985 commented 1 year ago

fxied: f94cc3a97ba6a7aa55af374655a2dd97fff53920