github-actions[bot] commented on code in PR #62440:
URL: https://github.com/apache/doris/pull/62440#discussion_r3079329970


##########
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);
+                throw new AnalysisException("No database selected");
             }

Review Comment:
   This changes a standard FE user-facing error into a generic 
`AnalysisException`.
   
   `CREATE/DROP ENCRYPTKEY` used to return `ERR_NO_DB_ERROR` here, which 
preserves the expected MySQL error code / SQLSTATE (`1046` / `3D000`) and 
matches nearby command paths in FE. Replacing it with `new 
AnalysisException("No database selected")` is a behavioral regression for 
clients and also violates the FE review guidance for user-visible errors.
   
   Please keep the 
`ErrorReport.reportAnalysisException(ErrorCode.ERR_NO_DB_ERROR)` path.



-- 
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]

Reply via email to