github-actions[bot] commented on code in PR #62440:
URL: https://github.com/apache/doris/pull/62440#discussion_r3072124186
##########
fe/fe-catalog/src/main/java/org/apache/doris/analysis/EncryptKeyName.java:
##########
@@ -51,12 +47,11 @@ public EncryptKeyName(List<String> parts) {
public void analyze() throws AnalysisException {
}
- public void analyze(ConnectContext ctx) throws AnalysisException {
- FeNameFormat.checkCommonName("EncryptKey", keyName);
+ public void analyze(String defaultDb) throws AnalysisException {
if (db == null) {
- db = ctx.getDatabase();
+ db = defaultDb;
if (Strings.isNullOrEmpty(db)) {
- ErrorReport.reportAnalysisException(ErrorCode.ERR_NO_DB_ERROR);
Review Comment:
This changed the no-default-database path from
`ErrorReport.reportAnalysisException(ErrorCode.ERR_NO_DB_ERROR)` to a raw
`AnalysisException("No database selected")`. `CreateEncryptkeyCommand` and
`DropEncryptkeyCommand` still call this on user input, so the same invalid
statement now returns a different FE error contract than before. Please keep
reporting `ERR_NO_DB_ERROR` here even though the method now accepts a
`defaultDb` string instead of `ConnectContext`.
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/TupleDescriptor.java:
##########
@@ -118,8 +120,29 @@ public String getExplainString() {
.add("tbl", tblStr));
builder.append("\n");
for (SlotDescriptor slot : slots) {
- builder.append(slot.getExplainString(prefix)).append("\n");
+ builder.append(getExplainString(slot, prefix)).append("\n");
}
return builder.toString();
}
+
+ public String getExplainString(SlotDescriptor slotDescriptor, String
prefix) {
+ String caption = slotDescriptor.getCaption();
+ Column column = slotDescriptor.getColumn();
Review Comment:
`TupleDescriptor#getExplainString()` used to delegate to
`SlotDescriptor#getExplainString(prefix)`, which was null-safe for `column` and
printed the real `isAutoInc` flag. This replacement changes both behaviors:
`Type type = column.getType();` now dereferences `column` before the later null
guard, so explain output will throw for valid slots that have no backing
column, and `isAutoIncrement` is now populated from
`slotDescriptor.isNullable()`. Reusing the slot-level formatter (or preserving
its null checks and `isAutoInc` field) would avoid the regression.
--
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]