Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-44273

Failure to parse certain time zone specifications on windows platforms.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.6.15, 4.0.13, 4.2.1
    • Fix Version/s: 4.5.1, 4.4.0-rc10
    • Component/s: Querying
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      Windows
    • Backport Requested:
      v4.4, v4.2, v4.0, v3.6
    • Steps To Reproduce:
      Hide

      criar um registro na coleção useevents

      db.getCollection('useevents').insert({
      "registeredAt" : ISODate("2019-10-27T02:00:30.627Z")
      })

      executar um aggregate

      db.getCollection('useevents').aggregate([{"$group":{"_id":{ "day":{"$dayOfMonth":{"date":"$registeredAt","timezone":"America/Sao_Paulo"}}},"count":{"$sum":1}}}])

      resultado esperado

      {
       "_id" : {
       "day" : 26
       },
       "count" : 1.0
      }

      resultado obtido

      {
       "_id" : {
       "day" : 27
       },
       "count" : 1.0
      }

      se alterarmos o aggregate executando colocando o offset manualmente, o resultado esperado é alcançado

      db.getCollection('useevents').aggregate([
       {"$group":{"_id":{ 
       "day":{"$dayOfMonth":{"date":"$registeredAt","timezone":"-03:00"}}},"count":{"$sum":1}}}])

      Show
      criar um registro na coleção useevents db.getCollection('useevents').insert({ "registeredAt" : ISODate("2019-10-27T02:00:30.627Z") }) executar um aggregate db.getCollection('useevents').aggregate([{"$group":{"_id":{ "day":{"$dayOfMonth":{"date":"$registeredAt","timezone":"America/Sao_Paulo"}}},"count":{"$sum":1}}}]) resultado esperado { "_id" : { "day" : 26 }, "count" : 1.0 } resultado obtido { "_id" : { "day" : 27 }, "count" : 1.0 } se alterarmos o aggregate executando colocando o offset manualmente, o resultado esperado é alcançado db.getCollection('useevents').aggregate([ {"$group":{"_id":{ "day":{"$dayOfMonth":{"date":"$registeredAt","timezone":"-03:00"}}},"count":{"$sum":1}}}])
    • Sprint:
      Query 2020-03-23, Query 2020-05-04, Query 2020-05-18, Query 2020-06-01, Query 2020-06-15
    • Case:

      Description

      On windows platforms it looks like certain time zone specifications are not parsed properly and are just silently ignored without being loaded. At this point it looks like it would be any file which contains a CTRL-Z character, which includes at least "America/Sao_Paulo".

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              james.wahlin James Wahlin
              Reporter:
              roberth.godoy@yahoo.com Roberth Godoy
              Participants:
              Votes:
              1 Vote for this issue
              Watchers:
              14 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: