seawinde commented on code in PR #66287:
URL: https://github.com/apache/doris/pull/66287#discussion_r3710181164


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/stream/BaseTableStream.java:
##########
@@ -198,7 +219,16 @@ public TableIf getBaseTableOrNereidsAnalysisException() 
throws AnalysisException
     }
 
     public List<String> getBaseTableFullQualifiers() {
-        return baseTableInfo.getFullQualifiers();
+        return getBaseTableFullQualifiers(getBaseTableNullable());
+    }
+
+    List<String> getBaseTableFullQualifiers(TableIf availableBaseTable) {
+        TableIf displayBaseTable = availableBaseTable;
+        if (displayBaseTable == null && baseTableInfo.isInternalTable()) {
+            displayBaseTable = 
Env.getCurrentRecycleBin().getRecycledTableNullable(
+                    baseTableInfo.getDbId(), baseTableInfo.getTableId());
+        }
+        return displayBaseTable == null ? baseTableInfo.getFullQualifiers() : 
displayBaseTable.getFullQualifiers();

Review Comment:
   Fixed the detached-table failure in `d2b13a42cf1`. Internal base-table 
qualifiers are now assembled without calling `getFullQualifiers()` on the 
recycled table: the database name is resolved by the stable `dbId`, and only 
the table name is read from the live/recycled table, with the persisted 
creation-time names as the final fallback. This keeps `table_streams` and `SHOW 
CREATE STREAM` valid after `DROP TABLE` followed by `ALTER DATABASE ... 
RENAME`, including Gson reload and recycle-entry erasure. Added 
`testBaseTableQualifiersFollowDatabaseRenameAfterDrop`; `./run-fe-ut.sh --run 
org.apache.doris.catalog.DropTableStreamTest` passes all 6 tests.



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