Skip to content

Commit

Permalink
[Bug] test suite test_table_options may cause NPE in FE #39457
Browse files Browse the repository at this point in the history
  • Loading branch information
Vallishp committed Aug 16, 2024
1 parent ed560bb commit 89540d1
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,11 @@ private static TFetchSchemaTableDataResult tableOptionsMetadataResult(TSchemaTab
String clg = params.getCatalog();
CatalogIf catalog = Env.getCurrentEnv().getCatalogMgr().getCatalog(clg);
DatabaseIf database = catalog.getDbNullable(dbId);
if (database == null) {
result.setDataBatch(dataBatch);
result.setStatus(new TStatus(TStatusCode.OK));
return result;
}
List<TableIf> tables = database.getTables();
if (catalog instanceof InternalCatalog) {
tableOptionsForInternalCatalog(currentUserIdentity, catalog, database, tables, dataBatch);
Expand Down Expand Up @@ -1222,6 +1227,11 @@ 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) {
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 89540d1

Please sign in to comment.