diff options
author | Ren <renctan@gmail.com> | 2012-02-10 17:00:03 -0500 |
---|---|---|
committer | Ren <renctan@gmail.com> | 2012-02-17 14:26:08 -0500 |
commit | 359803779413dd3f17ef1f9f5910a03b1163f283 (patch) | |
tree | f8574ebc18672c53bce5cac83113dbcdb0b263d6 /jstests/sharding | |
parent | d0542e44d90aa410bc82456f5ee1d06a73396b2c (diff) | |
download | mongo-359803779413dd3f17ef1f9f5910a03b1163f283.tar.gz |
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.
Diffstat (limited to 'jstests/sharding')
-rw-r--r-- | jstests/sharding/shard_with_special_db_names.js | 6 |
1 files changed, 6 insertions, 0 deletions
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 ); + })(); |