polardbx-sql icon indicating copy to clipboard operation
polardbx-sql copied to clipboard

In the USER management operation, when the hostname is not specified, it cannot be automatically set to%

Open yejr opened this issue 2 years ago • 5 comments

mysql>create user yejr identified by 'xx';  -- hostname  is not specified, treated as%
Query OK, 0 rows affected (0.12 sec)

mysql>show grants for yejr;  -- hostname  is not specified, treated as%
+----------------------------------+
| GRANTS FOR 'YEJR'@'%'            |
+----------------------------------+
| GRANT USAGE ON *.* TO 'yejr'@'%' |
+----------------------------------+
1 row in set (1.45 sec)

mysql>set password for yejr = password('xx');  -- hostname  is not specified, errors raised
ERROR 3009 (HY000): [154bfc7d7e002000][172.17.0.6:58709][d3]class com.alibaba.polardbx.druid.sql.ast.expr.SQLIdentifierExpr cannot be cast to class com.alibaba.polardbx.druid.sql.dialect.mysql.ast.expr.MySqlUserName (com.alibaba.polardbx.druid.sql.ast.expr.SQLIdentifierExpr and com.alibaba.polardbx.druid.sql.dialect.mysql.ast.expr.MySqlUserName are in unnamed module of loader 'app')

mysql>set password for yejr@'%' = password('xx');
Query OK, 0 rows affected (0.06 sec)

yejr avatar Nov 30 '22 01:11 yejr

This is a bug caused by MySqlExprParser. We will fix it.

F-ca7 avatar Nov 30 '22 09:11 F-ca7

This is a bug caused by MySqlExprParser. We will fix it.

if no one fixes it, you can assign this to me, i'm interested and may have a try.

joeCarf avatar Dec 01 '22 17:12 joeCarf

if no one fixes it, you can assign this to me, i'm interested and may have a try.

Sure. I will do the code review for your merge request.

F-ca7 avatar Dec 02 '22 09:12 F-ca7

if no one fixes it, you can assign this to me, i'm interested and may have a try.

Sure. I will do the code review for your merge request.

thanks a lot

joeCarf avatar Dec 02 '22 09:12 joeCarf

hi, i opened a merge request.https://github.com/ApsaraDB/galaxysql/pull/112 I think it will fix this bug. @F-ca7

joeCarf avatar Dec 02 '22 14:12 joeCarf