polardbx-sql
polardbx-sql copied to clipboard
Fix (issuse: #104) : Cast error when 'set password'
Problems solved in this PR
issuse: https://github.com/ApsaraDB/galaxysql/issues/104
Changes proposed in this PR
Tests
- [ ] Unit test
- [ ] DML_DDL test
Release note
None
@Oldbread3 PTAL:)
Will this fix cause exception for statement like set password for yejr@'%' = password('xx');
?
Amend use name at code path below might be the proper way to fix this issue. https://github.com/polardb/polardbx-sql/blob/ffd596b88044465c0bfdcda7d19a2882fe0acc89/polardbx-parser/src/main/java/com/alibaba/polardbx/druid/sql/dialect/mysql/parser/MySqlStatementParser.java#L6506
Amend use name at code path below might be the proper way to fix this issue.
https://github.com/polardb/polardbx-sql/blob/ffd596b88044465c0bfdcda7d19a2882fe0acc89/polardbx-parser/src/main/java/com/alibaba/polardbx/druid/sql/dialect/mysql/parser/MySqlStatementParser.java#L6506
when using statement set password for yejr@'%' = password('xx');
, variable user
is a MySqlUserName
object, while using set password for yejr = password('xx');
statement, user
is a SQLIdentifierExpr
object.
should i just cast SQLIdentifierExpr to MySqlUserName in MysqlStatementParser.class (code path above) or or use if
sentense just in code path below ?
https://github.com/polardb/polardbx-sql/blob/55ca0c9a51df795e8ad6bed4ce58cdd2d0c70eb3/polardbx-server/src/main/java/com/alibaba/polardbx/server/handler/privileges/polar/PolarSetPasswordHandler.java#L77
这个pr还不能合入嘛 @Oldbread3 @ZSYTY