summaryrefslogtreecommitdiff
path: root/src/mongo/db/namespace_string_test.cpp
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-06-23 15:23:36 -0400
committerGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-06-24 20:20:56 -0400
commitb4449789236d69805bad9511d15e288bebaa9d95 (patch)
tree7447cdacc4e1f4897bf0034261f3d9382023b191 /src/mongo/db/namespace_string_test.cpp
parentb855e5562dbf2404a7857c110dbb39b451bf13f3 (diff)
downloadmongo-b4449789236d69805bad9511d15e288bebaa9d95.tar.gz
SERVER-41694 Remove the restriction on collection name length
Diffstat (limited to 'src/mongo/db/namespace_string_test.cpp')
-rw-r--r--src/mongo/db/namespace_string_test.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mongo/db/namespace_string_test.cpp b/src/mongo/db/namespace_string_test.cpp
index f44406139bf..0d7989b3dc8 100644
--- a/src/mongo/db/namespace_string_test.cpp
+++ b/src/mongo/db/namespace_string_test.cpp
@@ -189,14 +189,11 @@ TEST(NamespaceStringTest, MakeDropPendingNamespace) {
ASSERT_EQUALS(NamespaceString{"test.system.drop.1234567i8t9.foo"},
NamespaceString{"test.foo"}.makeDropPendingNamespace(
repl::OpTime(Timestamp(Seconds(1234567), 8U), 9LL)));
- // If the collection name is too long to fit in the generated drop pending namespace, it will be
- // truncated.
- std::string dbName("test");
- std::string collName(std::size_t(NamespaceString::MaxNsCollectionLen) - dbName.size() - 1, 't');
- NamespaceString nss(dbName, collName);
- auto dropPendingNss =
- nss.makeDropPendingNamespace(repl::OpTime(Timestamp(Seconds(1234567), 8U), 9LL));
- ASSERT_EQUALS(std::size_t(NamespaceString::MaxNsCollectionLen), dropPendingNss.size());
+
+ std::string collName(8192, 't');
+ NamespaceString nss("test", collName);
+ ASSERT_EQUALS(NamespaceString{"test.system.drop.1234567i8t9." + collName},
+ nss.makeDropPendingNamespace(repl::OpTime(Timestamp(Seconds(1234567), 8U), 9LL)));
}
TEST(NamespaceStringTest, GetDropPendingNamespaceOpTime) {