From 4496ebb6329ba7af204c2e9f6bb6c865f7bfd3ff Mon Sep 17 00:00:00 2001 From: Mingyu Chen Date: Wed, 15 Jan 2020 20:04:09 +0800 Subject: [PATCH] [Alter View] Fix bug that alter view operation lost when replaying from image (#2773) When "replay" something, we should use Catalog.getCurrentCatalog() instead of Catalog.getInstance(), otherwise, we may get wrong Catalog instance. --- fe/src/main/java/org/apache/doris/alter/Alter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fe/src/main/java/org/apache/doris/alter/Alter.java b/fe/src/main/java/org/apache/doris/alter/Alter.java index 26ef5a57ee..9c2a008875 100644 --- a/fe/src/main/java/org/apache/doris/alter/Alter.java +++ b/fe/src/main/java/org/apache/doris/alter/Alter.java @@ -125,7 +125,6 @@ public class Alter { } finally { db.writeUnlock(); } - } public void processAlterTable(AlterTableStmt stmt) throws UserException { @@ -380,7 +379,7 @@ public class Alter { String inlineViewDef = alterViewInfo.getInlineViewDef(); List newFullSchema = alterViewInfo.getNewFullSchema(); - Database db = Catalog.getInstance().getDb(dbId); + Database db = Catalog.getCurrentCatalog().getDb(dbId); db.writeLock(); try { View view = (View) db.getTable(tableId);