-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: None
-
Component/s: Querying
-
Minor Change
-
ALL
-
Queries (including range queries) on one type will no longer match values of the other type. Previously the comparison depended on which type was on the left hand side, which is incompatible with a total ordering.
Original title: mongod assertion when attempt is made to compare a Date to a Timestamp
The assertion will happen when the collection contains a Date and the query filter is using a Timestamp, but not the other way around.
Here's the assertion and stack trace from a mongod running version 2.4.7.
Fri Nov 1 09:54:12.974 [conn2] Assertion: 13111:wrong type for field (a) 17 != 9 0x10044c66b 0x10042601e 0x1004260dd 0x100401380 0x10005ce97 0x1002227ec 0x100218a03 0x1002191da 0x1002236c2 0x1002238e0 0x10019b3f0 0x100239e0f 0x10014d796 0x100147ae5 0x100148a0c 0x1001492dc 0x10024093e 0x10024113f 0x1001ee28f 0x10000b802 0 mongod 0x000000010044c66b _ZN5mongo15printStackTraceERSo + 43 1 mongod 0x000000010042601e _ZN5mongo11msgassertedEiPKc + 174 2 mongod 0x00000001004260dd _ZN5mongo11msgassertedEiRKSs + 29 3 mongod 0x0000000100401380 _ZNK5mongo11BSONElement3chkEi + 800 4 mongod 0x000000010005ce97 _ZN5mongo20compareElementValuesERKNS_11BSONElementES2_ + 679 5 mongod 0x00000001002227ec _ZNK5mongo7Matcher11valuesMatchERKNS_11BSONElementES3_iRKNS_14ElementMatcherE + 100 6 mongod 0x0000000100218a03 _ZNK5mongo7Matcher13matchesDottedEPKcRKNS_11BSONElementERKNS_7BSONObjEiRKNS_14ElementMatcherEbPNS_12MatchDetailsE + 3459 7 mongod 0x00000001002191da _ZNK5mongo7Matcher7matchesERKNS_7BSONObjEPNS_12MatchDetailsE + 314 8 mongod 0x00000001002236c2 _ZNK5mongo19CoveredIndexMatcher7matchesERKNS_7BSONObjERKNS_7DiskLocEPNS_12MatchDetailsEb + 450 9 mongod 0x00000001002238e0 _ZNK5mongo19CoveredIndexMatcher14matchesCurrentEPNS_6CursorEPNS_12MatchDetailsE + 212 10 mongod 0x000000010019b3f0 _ZN5mongo6Cursor14currentMatchesEPNS_12MatchDetailsE + 56 11 mongod 0x0000000100239e0f _ZN5mongo8runCountEPKcRKNS_7BSONObjERSsRi + 1455 12 mongod 0x000000010014d796 _ZN5mongo8CmdCount3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 268 13 mongod 0x0000000100147ae5 _ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 37 14 mongod 0x0000000100148a0c _ZN5mongo7Command11execCommandEPS0_RNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb + 2516 15 mongod 0x00000001001492dc _ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 1036 16 mongod 0x000000010024093e _ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 46 17 mongod 0x000000010024113f _ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_ + 1551 18 mongod 0x00000001001ee28f _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 1519 19 mongod 0x000000010000b802 _ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE + 198 Fri Nov 1 09:54:12.991 [conn2] Count with ns: test.server3304 and query: { a: Timestamp 0|0 } failed with exception: 13111 wrong type for field (a) 17 != 9 code: 13111
- duplicates
-
SERVER-8386 Compare Date vs timestamp errors out, timestamp vs Date doesn't
- Closed
- is depended on by
-
CSHARP-1089 Test against non-mmapv1 storage engine
- Closed
- is duplicated by
-
SERVER-8010 Query anomaly with Date and Timestamp
- Closed
-
SERVER-11530 timestamp vs. date errors
- Closed
-
SERVER-12450 {$type: 17} with _id as date causes error
- Closed
-
SERVER-16510 WiredTiger Crash when inserting documents in a specific order
- Closed
-
SERVER-17321 Querying for timestamp against date field generates error
- Closed
-
SERVER-7141 Consider making timestamp and date non-comparable or make comparison symmetrical
- Closed
- is related to
-
SERVER-7141 Consider making timestamp and date non-comparable or make comparison symmetrical
- Closed
- links to