From 359803779413dd3f17ef1f9f5910a03b1163f283 Mon Sep 17 00:00:00 2001 From: Ren Date: Fri, 10 Feb 2012 17:00:03 -0500 Subject: SERVER-4954 Dropping a database of a sharded cluster that contains regex characters will not cleanup config docs More detail explanation of cause: When DBConfig::dropDatabase gets called, it will then call _dropShardedCollections. However, the collections that will get cleaned up is based from the _collections member variable, which is prepopulated with unescaped regex query at _load. --- jstests/sharding/shard_with_special_db_names.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'jstests/sharding/shard_with_special_db_names.js') diff --git a/jstests/sharding/shard_with_special_db_names.js b/jstests/sharding/shard_with_special_db_names.js index de46a0ef9ac..14ba12e6ea5 100644 --- a/jstests/sharding/shard_with_special_db_names.js +++ b/jstests/sharding/shard_with_special_db_names.js @@ -16,5 +16,11 @@ s.adminCommand( { shardcollection : specialNS, key : { num : 1 } } ); var exists = s.getDB("config").collections.find( { _id: specialNS } ).count(); assert.eq( exists, 1 ); +// Test that drop database properly cleans up config +s.getDB(specialDB).dropDatabase(); + +exists = s.getDB(specialDB).collections.find( { _id: specialNS } ).count(); +assert.eq( exists, 0 ); + })(); -- cgit v1.2.1