mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
array elt may not contain referenced subobject
This commit is contained in:
parent
e09106351e
commit
0b73b8d325
@ -644,7 +644,9 @@ assert( !eloc.isNull() );
|
||||
if ( e.eoo() )
|
||||
break;
|
||||
|
||||
if ( strlen( nameWithinArray ) != 0 ) {
|
||||
if ( nameWithinArray[ 0 ] != '\0' ) {
|
||||
if ( e.type() != Object )
|
||||
continue;
|
||||
e = e.embeddedObject().getFieldDotted( nameWithinArray );
|
||||
if ( e.eoo() )
|
||||
continue;
|
||||
|
@ -381,6 +381,20 @@ namespace NamespaceTests {
|
||||
}
|
||||
};
|
||||
|
||||
class SubobjectMissing : public Base {
|
||||
public:
|
||||
void run() {
|
||||
create();
|
||||
BSONObjSetDefaultOrder keys;
|
||||
id().getKeysFromObject( fromjson( "{a:[1,2]}" ), keys );
|
||||
checkSize( 0, keys );
|
||||
}
|
||||
private:
|
||||
virtual BSONObj key() const {
|
||||
return aDotB();
|
||||
}
|
||||
};
|
||||
|
||||
// TODO
|
||||
// array subelement complex
|
||||
// parallel arrays complex
|
||||
@ -584,6 +598,7 @@ namespace NamespaceTests {
|
||||
add< IndexDetailsTests::ArraySubobjectSingleMissing >();
|
||||
add< IndexDetailsTests::ArraySubobjectMissing >();
|
||||
add< IndexDetailsTests::MissingField >();
|
||||
add< IndexDetailsTests::SubobjectMissing >();
|
||||
add< NamespaceDetailsTests::Create >();
|
||||
add< NamespaceDetailsTests::SingleAlloc >();
|
||||
add< NamespaceDetailsTests::Realloc >();
|
||||
|
Loading…
Reference in New Issue
Block a user