github-actions[bot] commented on code in PR #69088:
URL: https://github.com/apache/doris/pull/69088#discussion_r4281785177
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java:
##########
@@ -6238,6 +6238,14 @@ public void renameColumn(Database db, OlapTable table,
RenameColumnOp renameColu
try {
String colName = renameColumnOp.getColName();
String newColName = renameColumnOp.getNewColName();
+ Column column = table.getColumn(colName);
Review Comment:
[P2] Validate the column resolved by the rename implementation
This lookup uses raw names, but the private rename resolves columns through
`MaterializedIndexMeta.getColumnByName`, which removes every backtick. With
Unicode names enabled (the default), this accepted schema bypasses the new
restriction:
```sql
CREATE TABLE t (k INT, `v``x` STRING, vx VARIANT)
DUPLICATE KEY(k) DISTRIBUTED BY HASH(k) BUCKETS 1
PROPERTIES ('replication_num'='1');
ALTER TABLE t RENAME COLUMN `v``x` TO `bad.x`;
```
Here the guard checks the STRING column, while the normalized index map
selects the later `vx` VARIANT column for mutation. The statement therefore
persists a dotted VARIANT name instead of rejecting it. Validate the same
resolved column(s) that will be mutated, and add an escaped-backtick collision
case to the tests.
--
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]