diff options
Diffstat (limited to 'db/namespace.h')
-rw-r--r-- | db/namespace.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/db/namespace.h b/db/namespace.h index 7479a21da24..ee15eea9887 100644 --- a/db/namespace.h +++ b/db/namespace.h @@ -260,11 +260,15 @@ namespace mongo { bool isMultikey(int i) { return (multiKeyIndexBits & (((unsigned long long) 1) << i)) != 0; } void setIndexIsMultikey(int i) { dassert( i < NIndexesMax ); - multiKeyIndexBits |= (((unsigned long long) 1) << i); + unsigned long long x = ((unsigned long long) 1) << i; + if( multiKeyIndexBits & x ) return; + *dur::writing(&multiKeyIndexBits) |= x; } void clearIndexIsMultikey(int i) { dassert( i < NIndexesMax ); - multiKeyIndexBits &= ~(((unsigned long long) 1) << i); + unsigned long long x = ((unsigned long long) 1) << i; + if( (multiKeyIndexBits & x) == 0 ) return; + *dur::writing(&multiKeyIndexBits) &= ~x; } /* add a new index. does not add to system.indexes etc. - just to NamespaceDetails. |