Skip to content

Commit

Permalink
exmdb: resolve recalc_store_size SQL error for empty stores
Browse files Browse the repository at this point in the history
References: GXH-108
  • Loading branch information
jengelh committed Nov 9, 2024
1 parent c9dec39 commit 58a0cfe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exch/exmdb/store2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,8 @@ BOOL exmdb_server::recalc_store_size(const char *dir, uint32_t flags)
auto comp = [&](proptag_t tag, const char *wh) {
char query[240];
gx_snprintf(query, std::size(query), "REPLACE INTO store_properties "
"(proptag,propval) VALUES (%u, (SELECT SUM(message_size) "
"FROM messages WHERE %s))",
"(proptag,propval) VALUES (%u, (SELECT COALESCE((SELECT SUM(message_size) "
"FROM messages WHERE %s), 0)))",
tag, wh);
gx_sql_exec(idb, query);
};
Expand Down

0 comments on commit 58a0cfe

Please sign in to comment.