diff options
author | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2018-11-28 19:12:16 -0500 |
---|---|---|
committer | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2018-11-30 13:05:09 -0500 |
commit | e0be8ba5aa04df21f6a9a42578a349a4c303776d (patch) | |
tree | 24308277dda3cf06f4870761beb9a817c1f511fd /src/mongo/db/storage/kv/kv_catalog.cpp | |
parent | 839d887bbb5c857c80ad50eb329c0017cb69190d (diff) | |
download | mongo-e0be8ba5aa04df21f6a9a42578a349a4c303776d.tar.gz |
SERVER-35732 Fix dbStats.fsUsedSize behavior for database with hyphenated names
Diffstat (limited to 'src/mongo/db/storage/kv/kv_catalog.cpp')
-rw-r--r-- | src/mongo/db/storage/kv/kv_catalog.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/storage/kv/kv_catalog.cpp b/src/mongo/db/storage/kv/kv_catalog.cpp index 28736f8598e..b28f509e80a 100644 --- a/src/mongo/db/storage/kv/kv_catalog.cpp +++ b/src/mongo/db/storage/kv/kv_catalog.cpp @@ -347,6 +347,14 @@ std::string KVCatalog::newTempIdent() { return buf.str(); } +std::string KVCatalog::getFilesystemPathForDb(const std::string& dbName) const { + if (_directoryPerDb) { + return storageGlobalParams.dbpath + '/' + escapeDbName(dbName); + } else { + return storageGlobalParams.dbpath; + } +} + std::string KVCatalog::_newUniqueIdent(StringData ns, const char* kind) { // If this changes to not put _rand at the end, _hasEntryCollidingWithRand will need fixing. StringBuilder buf; |