diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedStoragePersistServiceImpl.java b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedStoragePersistServiceImpl.java index 83baef99932..294fc589b23 100755 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedStoragePersistServiceImpl.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedStoragePersistServiceImpl.java @@ -1116,16 +1116,26 @@ public int configInfoTagCount() { @Override public List getTenantIdList(int page, int pageSize) { - String sql = "SELECT tenant_id FROM config_info WHERE tenant_id != '' GROUP BY tenant_id LIMIT ?, ?"; + PaginationHelper helper = createPaginationHelper(); + + String sql = "SELECT tenant_id FROM config_info WHERE tenant_id != '' GROUP BY tenant_id LIMIT ?,?"; int from = (page - 1) * pageSize; - return databaseOperate.queryMany(sql, new Object[] {from, pageSize}, String.class); + + Page pageList = helper.fetchPageLimit(sql, new Object[] {from, pageSize}, page, pageSize, + (resultSet, i) -> resultSet.getString("tenant_id")); + return pageList.getPageItems(); } @Override public List getGroupIdList(int page, int pageSize) { - String sql = "SELECT group_id FROM config_info WHERE tenant_id ='' GROUP BY group_id LIMIT ?, ?"; + PaginationHelper helper = createPaginationHelper(); + + String sql = "SELECT group_id FROM config_info WHERE tenant_id ='' GROUP BY group_id LIMIT ?,?"; int from = (page - 1) * pageSize; - return databaseOperate.queryMany(sql, new Object[] {from, pageSize}, String.class); + + Page pageList = helper.fetchPageLimit(sql, new Object[] {from, pageSize}, page, pageSize, + (resultSet, i) -> resultSet.getString("group_id")); + return pageList.getPageItems(); } @Override