Skip to content

Commit

Permalink
[branch-2.1][Bug] test suite test_table_options may cause NPE in FE #…
Browse files Browse the repository at this point in the history
…39457 (#39509) (#40018)

## Proposed changes

pick #39509

Co-authored-by: Vallish Pai <[email protected]>
  • Loading branch information
wangbo and Vallishp authored Aug 28, 2024
1 parent ddf72ce commit 42f30d4
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,15 @@ private static TFetchSchemaTableDataResult tablePropertiesMetadataResult(TSchema
CatalogIf catalog = Env.getCurrentEnv().getCatalogMgr().getCatalog(clg);
List<TRow> dataBatch = Lists.newArrayList();
DatabaseIf database = catalog.getDbNullable(dbId);
if (database == null) {
// BE gets the database id list from FE and then invokes this interface
// per database. there is a chance that in between database can be dropped.
// so need to handle database not exist case and return ok so that BE continue the
// loop with next database.
result.setDataBatch(dataBatch);
result.setStatus(new TStatus(TStatusCode.OK));
return result;
}
List<TableIf> tables = database.getTables();
if (catalog instanceof InternalCatalog) {
tablePropertiesForInternalCatalog(currentUserIdentity, catalog, database, tables, dataBatch);
Expand Down

0 comments on commit 42f30d4

Please sign in to comment.