summaryrefslogtreecommitdiff
path: root/db/pdfile.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-12-12 11:19:50 -0500
committerEliot Horowitz <eliot@10gen.com>2010-12-12 11:19:50 -0500
commit47d2007d88f9f8f93bb7c8af269246e94e22f76d (patch)
treebf8698d20d18dfc9d704f7e387e6c7152a3258f0 /db/pdfile.cpp
parent60447a06f3c3bf4867c343d568d37daf47544bfe (diff)
downloadmongo-47d2007d88f9f8f93bb7c8af269246e94e22f76d.tar.gz
can never change _id with a full object update SERVER-2206
Diffstat (limited to 'db/pdfile.cpp')
-rw-r--r--db/pdfile.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/db/pdfile.cpp b/db/pdfile.cpp
index 83db825487e..8a221d8eda6 100644
--- a/db/pdfile.cpp
+++ b/db/pdfile.cpp
@@ -921,7 +921,7 @@ namespace mongo {
NamespaceDetails *d,
NamespaceDetailsTransient *nsdt,
Record *toupdate, const DiskLoc& dl,
- const char *_buf, int _len, OpDebug& debug, bool &changedId, bool god)
+ const char *_buf, int _len, OpDebug& debug, bool god)
{
StringBuilder& ss = debug.str;
dassert( toupdate == dl.rec() );
@@ -948,7 +948,9 @@ namespace mongo {
below. that is suboptimal, but it's pretty complicated to do it the other way without rollbacks...
*/
vector<IndexChanges> changes;
+ bool changedId;
getIndexChanges(changes, *d, objNew, objOld, changedId);
+ uassert( 13596 , "cannot change _id of a document " , ! changedId );
dupCheck(changes, *d, dl);
if ( toupdate->netLength() < objNew.objsize() ) {