github-actions[bot] commented on code in PR #63216:
URL: https://github.com/apache/doris/pull/63216#discussion_r3233443280
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/AlterMTMVRenameInfo.java:
##########
@@ -53,18 +53,25 @@ public AlterMTMVRenameInfo(TableNameInfo mvName, String
newName) {
public void analyze(ConnectContext ctx) throws AnalysisException {
super.analyze(ctx);
try {
- FeNameFormat.checkTableName(newName);
+ FeNameFormat.checkTableName(newName.getTbl());
} catch (org.apache.doris.common.AnalysisException e) {
throw new AnalysisException(e.getMessage(), e);
}
+ if (newName.getCtl() != null || newName.getDb() != null) {
+ newName.analyze(ctx.getNameSpaceContext());
+ if (!mvName.getCtl().equalsIgnoreCase(newName.getCtl())
Review Comment:
Internal database names are stored and looked up with exact keys
(`InternalCatalog.fullNameToDb.containsKey/getDbNullable`), so `Test` and
`test` can coexist. With this case-insensitive comparison, `ALTER MATERIALIZED
VIEW Test.mv RENAME test.new_mv` is accepted, but `run()` still calls
`getDbOrDdlException(mvName.getDb())` and renames inside `Test`, not the
qualified target DB. Please compare the DB names exactly and add a negative
test for case-distinct DB names.
```suggestion
if (!mvName.getCtl().equalsIgnoreCase(newName.getCtl())
|| !mvName.getDb().equals(newName.getDb())) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]