chaoyli commented on a change in pull request #4029:
URL: https://github.com/apache/incubator-doris/pull/4029#discussion_r450621125



##########
File path: fe/src/main/cup/sql_parser.cup
##########
@@ -879,7 +879,11 @@ alter_table_clause ::=
     :}
     | KW_DROP opt_tmp:isTempPartition KW_PARTITION opt_if_exists:ifExists 
ident:partitionName
     {:
-        RESULT = new DropPartitionClause(ifExists, partitionName, 
isTempPartition);
+        RESULT = new DropPartitionClause(ifExists, partitionName, 
isTempPartition, !isTempPartition);
+    :}
+    | KW_DROPP opt_tmp:isTempPartition KW_PARTITION opt_if_exists:ifExists 
ident:partitionName

Review comment:
       DROPP is a not a good syntax. It's better to use
   ```
   DROP TABLE $table_name FORCE
   ```

##########
File path: fe/src/main/java/org/apache/doris/catalog/Catalog.java
##########
@@ -2666,6 +2666,13 @@ public void dropDb(DropDbStmt stmt) throws DdlException {
             Database db = this.fullNameToDb.get(dbName);
             db.writeLock();
             try {
+                if (stmt.isNeedCheckCommittedTxns()) {
+                    if 
(Catalog.getCurrentCatalog().getGlobalTransactionMgr().existCommittedTxns(db.getId(),
 null, null)) {
+                       throw new DdlException("There are still some 
transactions in the COMMITTED state waiting to be completed. " +
+                               "The database [" + dbName +"] cannot be 
dropped. If you want to forcibly drop(cannot be recovered)," +
+                               " please use \"DROP database force\".");
+                    }

Review comment:
       DROP database FORCE. Use upper case will be better.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to