Copilot commented on code in PR #37394:
URL: https://github.com/apache/shardingsphere/pull/37394#discussion_r2620314539


##########
parser/sql/engine/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/engine/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java:
##########
@@ -847,6 +849,11 @@ public ASTNode visitDropDatabase(final DropDatabaseContext 
ctx) {
         return new DropDatabaseStatement(getDatabaseType(), ((IdentifierValue) 
visit(ctx.name())).getValue(), null != ctx.ifExists());
     }
     
+    @Override
+    public ASTNode visitAlterDatabase(final AlterDatabaseContext ctx) {
+        return new AlterDatabaseStatement(getDatabaseType());

Review Comment:
   The `visitAlterDatabase` method creates an `AlterDatabaseStatement` without 
extracting any information from the context (e.g., database name, configuration 
parameters being set). This results in an incomplete statement object that 
doesn't capture the actual ALTER DATABASE operation details. Consider 
extracting the database name from `ctx.name()` similar to how 
`visitDropDatabase` handles it.
   ```suggestion
           return new AlterDatabaseStatement(getDatabaseType(), 
((IdentifierValue) visit(ctx.name())).getValue());
   ```



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

Reply via email to