[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.
This commit is contained in:
Mingyu Chen
2020-01-15 20:04:09 +08:00
committed by GitHub
parent 7fe6431ac7
commit 4496ebb632

View File

@ -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<Column> newFullSchema = alterViewInfo.getNewFullSchema();
Database db = Catalog.getInstance().getDb(dbId);
Database db = Catalog.getCurrentCatalog().getDb(dbId);
db.writeLock();
try {
View view = (View) db.getTable(tableId);