summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2013-01-09 14:47:34 -0500
committerEliot Horowitz <eliot@10gen.com>2013-01-09 14:47:34 -0500
commit0a6bac4569c92c7ef92cb4b66f5ec0797b1334af (patch)
treed5bcbf5e7da7e421f539c3f2d9ca4218fa1e0199
parent38f42b2a42011c23385ba899ab84f78bfa9dc1af (diff)
downloadmongo-0a6bac4569c92c7ef92cb4b66f5ec0797b1334af.tar.gz
SERVER-7511: fix backport for 2.2
-rw-r--r--src/mongo/db/ops/update_internal.cpp2
-rw-r--r--src/mongo/db/ops/update_internal.h7
2 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/db/ops/update_internal.cpp b/src/mongo/db/ops/update_internal.cpp
index 3d63bd61270..e91d56b3f08 100644
--- a/src/mongo/db/ops/update_internal.cpp
+++ b/src/mongo/db/ops/update_internal.cpp
@@ -1113,7 +1113,7 @@ namespace mongo {
updateIsIndexed( i->second, idxKeys , backgroundKeys );
}
- bool getCanonicalIndexField( const StringData& fullName, string* out ) {
+ bool getCanonicalIndexField( const string& fullName, string* out ) {
// check if fieldName contains ".$" or ".###" substrings (#=digit) and skip them
if ( fullName.find( '.' ) == string::npos )
return false;
diff --git a/src/mongo/db/ops/update_internal.h b/src/mongo/db/ops/update_internal.h
index 6b09e0dc37b..b486cadefb9 100644
--- a/src/mongo/db/ops/update_internal.h
+++ b/src/mongo/db/ops/update_internal.h
@@ -34,7 +34,7 @@ namespace mongo {
* a.$ -> a
* @return true if out is set and we made a change
*/
- bool getCanonicalIndexField( const StringData& fullName, string* out );
+ bool getCanonicalIndexField( const string& fullName, string* out );
/* Used for modifiers such as $inc, $set, $push, ...
* stores the info about a single operation
@@ -165,13 +165,14 @@ namespace mongo {
* @return true iff the mod is indexed
*/
bool isIndexed( const set<string>& idxKeys ) const {
+ string myFieldName = fieldName;
// first, check if full name is in idxKeys
- if ( isIndexed( fieldName , idxKeys ) )
+ if ( isIndexed( myFieldName , idxKeys ) )
return true;
string x;
- if ( getCanonicalIndexField( fieldName, &x ) ) {
+ if ( getCanonicalIndexField( myFieldName, &x ) ) {
if ( isIndexed( x, idxKeys ) )
return true;
}