[SERVER-12473] $all and dotted fields difference behavior in 2.4 and 2.5 Created: 24/Jan/14  Updated: 05/May/14  Resolved: 14/Feb/14

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Andrew Emil (Inactive) Assignee: Benety Goh
Resolution: Cannot Reproduce Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File server12473.js    
Issue Links:
Related
related to SERVER-12471 $all with array objects, differs in 2... Closed
Backwards Compatibility: Major Change
Operating System: ALL
Participants:

 Description   

Seems like the way we are matching dotted fields with $all has changed between 2.4 and 2.5.5-pre, not sure what the correct behavior is here.

In 2.5:

> rdoc
{ "_id" : 0, "a" : [ null, [ ISODate("9999-12-31T00:00:00Z") ] ] }
> db.r2.insert(rdoc)
> db.r2.find({"a.1":{"$all":[ISODate("9999-12-31")]}} )
> db.runCommand({buildinfo:1})
{
        "version" : "2.5.5-pre-",
        "gitVersion" : "f65a0b814b8c77e3fbe90bca0c061c9b77f6acdb",
        "OpenSSLVersion" : "",
        "sysInfo" : "Darwin Andrew-Emil-MacBook-Pro.local 12.4.0 Darwin Kernel Version 12.4.0: Wed May  1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49",
        "loaderFlags" : "-fPIC -pthread -Wl,-bind_at_load -mmacosx-version-min=10.6",
        "compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -pipe -O3 -Wno-unused-function -Wno-deprecated-declarations -mmacosx-version-min=10.6",
        "allocator" : "tcmalloc",
        "versionArray" : [
                2,
                5,
                5,
                -100
        ],
        "javascriptEngine" : "V8",
        "bits" : 64,
        "debug" : false,
        "maxBsonObjectSize" : 16777216,
        "ok" : 1
}

In 2.4:

> rdoc
{ "_id" : 0, "a" : [ null, [ ISODate("9999-12-31T00:00:00Z") ] ] }
> mydb.r2.insert(rdoc)
> mydb.r2.find({"a.1":{"$all":[ISODate("9999-12-31")]}} )
{ "_id" : 0, "a" : [  null,  [  ISODate("9999-12-31T00:00:00Z") ] ] }



 Comments   
Comment by Githook User [ 15/Feb/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-12473 additional test case for all operator with empty strings and ISO dates.
Branch: master
https://github.com/mongodb/mongo/commit/d18bbbd685aa80cce67a4642082f97a1cba9081f

Comment by Githook User [ 14/Feb/14 ]

Author:

{u'username': u'IanWhalen', u'name': u'Ian Whalen', u'email': u'ian@mongodb.com'}

Message: Revert "SERVER-12473 additional test case for all operator with empty strings and ISO dates."

This reverts commit 016cd39853ecdf7b5d38a03b6bd1ce9ad993ef7e.

Reverting because this broke expression_parser_test on Linux 32
Branch: master
https://github.com/mongodb/mongo/commit/d7e88f5d08e3a872f7bfb223d1f695235f01909a

Comment by Benety Goh [ 14/Feb/14 ]

feel free to reopen if the test cases i've added are not consistent with the ones in the description.

Comment by Githook User [ 14/Feb/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-12473 additional test case for all operator with empty strings and ISO dates.
Branch: master
https://github.com/mongodb/mongo/commit/016cd39853ecdf7b5d38a03b6bd1ce9ad993ef7e

Comment by Andrew Emil (Inactive) [ 04/Feb/14 ]

Got a different repro that does work for me. Seems to be a very similar issue, but not identical, should I open a new ticket for this?

2.5.6-pre:

> db.test.insert({_id:0, a: [{}, [""]]})
SingleWriteResult({
        "writeErrors" : [ ],
        "writeConcernErrors" : [ ],
        "nInserted" : 1,
        "nUpserted" : 0,
        "nUpdated" : 0,
        "nModified" : 0,
        "nRemoved" : 0,
        "upserted" : [ ]
})
> db.test.find({"a.1": {$all: [""]}})
>
> db.test.runCommand({buildinfo:1})
{
        "version" : "2.5.6-pre-",
        "gitVersion" : "8f84eec7d3be1bf9ff21bc5943af3cdc7fdefe41",
        "OpenSSLVersion" : "",
        "sysInfo" : "Darwin Andrew-Emil-MacBook-Pro.local 12.4.0 Darwin Kernel Version 12.4.0: Wed May  1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49",
        "loaderFlags" : "-fPIC -pthread -Wl,-bind_at_load -mmacosx-version-min=10.6",
        "compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -pipe -O3 -Wno-unused-function -Wno-deprecated-declarations -mmacosx-version-min=10.6",
        "allocator" : "tcmalloc",
        "versionArray" : [
                2,
                5,
                6,
                -100
        ],
        "javascriptEngine" : "V8",
        "bits" : 64,
        "debug" : false,
        "maxBsonObjectSize" : 16777216,
        "ok" : 1
}

2.4.9:

> mydb.test.insert({_id:0, a: [{}, [""]]})
> mydb.test.find({"a.1": {$all: [""]}})
{ "_id" : 0, "a" : [ {  }, [ "" ] ] }

Comment by Andrew Emil (Inactive) [ 31/Jan/14 ]

Tried this again...cannot repro, closing for now, probably a mistake on my part, sorry!

Generated at Thu Feb 08 03:28:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.