-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
Observed behavior: Verify assertion when a date operator is applied to a date before 1970.
Expected behavior: Proper handling of dates before 1970 or else uassert
Test:
c = db.c;
c.drop();
c.save( {} );
c.aggregate( { $project:{ a:{ $year:[ new Date( 1960, 0, 1 ) ] } } } );
Log:
Sat Jun 23 20:01:10 [conn14] Assertion failure (long long)millis >= 0 src/mongo/bson/util/misc.h 96 0x104095055 0x10463dbfb 0x103f24419 0x1042034a3 0x1040ffe3e 0x1040dea0e 0x1040dce2a 0x1040ed03e 0x103e2d320 0x104517941 0x1045c4e51 0x10446b87e 0x10446d5eb 0x10446ea40 0x1046606e5 0x1046611bb 0x1043e5382 0x1043ea0b0 0x103d469c7 0x1045d0f0e 0 mongod 0x0000000104095055 _ZN5mongo15printStackTraceERSo + 37 1 mongod 0x000000010463dbfb _ZN5mongo10logContextEPKc + 123 2 mongod 0x0000000103f24419 _ZN5mongo12verifyFailedEPKcS1_j + 409 3 mongod 0x00000001042034a3 _ZNK5mongo6Date_t7toTimeTEv + 67 4 mongod 0x00000001040ffe3e _ZN5mongo6Date_t4toTmEP2tm + 28 5 mongod 0x00000001040dea0e _ZNK5mongo14ExpressionYear8evaluateERKN5boost13intrusive_ptrINS_8DocumentEEE + 216 6 mongod 0x00000001040dce2a _ZN5mongo14ExpressionNary8optimizeEv + 866 7 mongod 0x00000001040ed03e _ZN5mongo16ExpressionObject8optimizeEv + 136 8 mongod 0x0000000103e2d320 _ZN5mongo21DocumentSourceProject8optimizeEv + 68 9 mongod 0x0000000104517941 _ZN5mongo8Pipeline12parseCommandERSsRNS_7BSONObjERKN5boost13intrusive_ptrINS_17ExpressionContextEEE + 4867 10 mongod 0x00000001045c4e51 _ZN5mongo15PipelineCommand3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 145 11 mongod 0x000000010446b87e _ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRNS_14BSONObjBuilderEb + 142 12 mongod 0x000000010446d5eb _ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb + 4587 13 mongod 0x000000010446ea40 _ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 1472 14 mongod 0x00000001046606e5 _ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 117 15 mongod 0x00000001046611bb _ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_ + 1595 16 mongod 0x00000001043e5382 _ZN5mongoL13receivedQueryERNS_6ClientERNS_10DbResponseERNS_7MessageE + 418 17 mongod 0x00000001043ea0b0 _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 1136 18 mongod 0x0000000103d469c7 _ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE + 261 19 mongod 0x00000001045d0f0e _ZN5mongo3pms9threadRunEPNS_13MessagingPortE + 1630