morningman commented on code in PR #70338:
URL: https://github.com/apache/doris/pull/70338#discussion_r4500922901
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilderForEncryption.java:
##########
@@ -115,6 +115,15 @@ public LogicalPlan
visitCreateCatalog(DorisParser.CreateCatalogContext ctx) {
return super.visitCreateCatalog(ctx);
}
+ // alter catalog clause (ALTER CATALOG ... SET PROPERTIES(...))
+ @Override
+ public LogicalPlan
visitAlterCatalogProperties(DorisParser.AlterCatalogPropertiesContext ctx) {
+ DorisParser.PropertyItemListContext properties =
ctx.propertyItemList();
+ encryptProperty(visitPropertyItemList(properties),
properties.start.getStartIndex(),
+ properties.stop.getStopIndex());
Review Comment:
Thanks, confirmed. This is a defect the engine already had, not one this PR
introduces: when a statement contains a supplementary character, the parser's
token positions count code points, while `BaseViewInfo.rewriteSql` cuts the
Java string by UTF-16 offsets. Every masking visitor in
`LogicalPlanBuilderForEncryption` shares it (CREATE CATALOG, repositories, SET
PASSWORD and the rest), and so does the rewriting of view and MTMV definitions;
the ALTER CATALOG masking added here goes through the same `rewriteSql`.
It is fixed separately in #70366, which converts the positions at all five
places that cut the original SQL and adds cases with emoji in values, in
comments before the masked span, and across several replacements in one
statement. Once that is merged, the ALTER CATALOG path in this PR gets the fix
without a change here.
--
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]