summaryrefslogtreecommitdiff
path: root/db/namespace.cpp
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2011-08-23 08:47:17 +0200
committerAntonin Kral <a.kral@bobek.cz>2011-08-23 08:47:17 +0200
commitcbe2d992e9cd1ea66af9fa91df006106775d3073 (patch)
treefca8e11a8ab7f063ae26802016068f9c814f6176 /db/namespace.cpp
parent64b33ee522375a8dc15be2875dfb7db4502259b0 (diff)
downloadmongodb-cbe2d992e9cd1ea66af9fa91df006106775d3073.tar.gz
Imported Upstream version 1.8.3
Diffstat (limited to 'db/namespace.cpp')
-rw-r--r--db/namespace.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/db/namespace.cpp b/db/namespace.cpp
index fcdaee2..0cb0e74 100644
--- a/db/namespace.cpp
+++ b/db/namespace.cpp
@@ -598,6 +598,17 @@ namespace mongo {
}
}
+ void NamespaceDetailsTransient::eraseForPrefix(const char *prefix) {
+ assertInWriteLock();
+ vector< string > found;
+ for( ouriter i = _map.begin(); i != _map.end(); ++i )
+ if ( strncmp( i->first.c_str(), prefix, strlen( prefix ) ) == 0 )
+ found.push_back( i->first );
+ for( vector< string >::iterator i = found.begin(); i != found.end(); ++i ) {
+ _map.erase(*i);
+ }
+ }
+
void NamespaceDetailsTransient::computeIndexKeys() {
_keysComputed = true;
_indexKeys.clear();
@@ -648,7 +659,7 @@ namespace mongo {
// index details across commands are in cursors and nsd
// transient (including query cache) so clear these.
ClientCursor::invalidate( from );
- NamespaceDetailsTransient::clearForPrefix( from );
+ NamespaceDetailsTransient::eraseForPrefix( from );
NamespaceDetails *details = ni->details( from );
ni->add_ns( to, *details );