summaryrefslogtreecommitdiff
path: root/db/dbcommands.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-10-17 22:59:27 -0400
committerEliot Horowitz <eliot@10gen.com>2010-10-17 22:59:27 -0400
commit527b3afb737930f32b91745178790f9632daa316 (patch)
tree151e7da6a0250f20d4f4c93896f4e63e986e42ed /db/dbcommands.cpp
parent8b29ca04e5cbd71ea855d4b94c69c6ae764e2227 (diff)
downloadmongo-527b3afb737930f32b91745178790f9632daa316.tar.gz
consistent name for tmp
Diffstat (limited to 'db/dbcommands.cpp')
-rw-r--r--db/dbcommands.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp
index ea7ea4e2a45..7a36eaaea54 100644
--- a/db/dbcommands.cpp
+++ b/db/dbcommands.cpp
@@ -1251,12 +1251,15 @@ namespace mongo {
return false;
}
+ string shortTmpName = str::stream() << ".tmp.convertToCapped." << from;
+ string longTmpName = str::stream() << dbname << "." << shortTmpName;
+
DBDirectClient client;
- client.dropCollection( dbname + "." + from + ".$temp_convertToCapped" );
+ client.dropCollection( longTmpName );
BSONObj info;
if ( !client.runCommand( dbname ,
- BSON( "cloneCollectionAsCapped" << from << "toCollection" << ( from + ".$temp_convertToCapped" ) << "size" << double( size ) ),
+ BSON( "cloneCollectionAsCapped" << from << "toCollection" << shortTmpName << "size" << double( size ) ),
info ) ) {
errmsg = "cloneCollectionAsCapped failed: " + info.toString();
return false;
@@ -1268,8 +1271,8 @@ namespace mongo {
}
if ( !client.runCommand( "admin",
- BSON( "renameCollection" << ( dbname + "." + from + ".$temp_convertToCapped" )
- << "to" << ( dbname + "." + from ) ),
+ BSON( "renameCollection" << longTmpName <<
+ "to" << ( dbname + "." + from ) ),
info ) ) {
errmsg = "renameCollection failed: " + info.toString();
return false;