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

Failure to parse certain time zone specifications on windows platforms.

    • Fully Compatible
    • Windows
    • v4.4, v4.2, v4.0, v3.6
    • 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}}}])
    • Query 2020-03-23, Query 2020-05-04, Query 2020-05-18, Query 2020-06-01, Query 2020-06-15

      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".

       

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

              Created:
              Updated:
              Resolved: