Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-27862

DATE_TRUNC_STR gives incorrect results for boundary conditions

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.6.4, 5.1.0, 5.5.0
    • 5.5.0
    • query
    • Untriaged
    • Unknown

    Description

      Issue is, when golang parses the location it should default to UTC instead of the system timezone. We need to be able to explicitly set the timezoneto UTC if we wish to override this. 

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          Build couchbase-server-5.5.0-1839 contains query commit 3bdfa0a4ff3be0192b61f00a014b06fd28db0298 with commit message:
          MB-27862 Fix boundary condition behavior with DATE_TRUNC_STR
          https://github.com/couchbase/query/commit/3bdfa0a4ff3be0192b61f00a014b06fd28db0298

          build-team Couchbase Build Team added a comment - Build couchbase-server-5.5.0-1839 contains query commit 3bdfa0a4ff3be0192b61f00a014b06fd28db0298 with commit message: MB-27862 Fix boundary condition behavior with DATE_TRUNC_STR https://github.com/couchbase/query/commit/3bdfa0a4ff3be0192b61f00a014b06fd28db0298
          ajay.bhullar Ajay Bhullar added a comment -

          Can you provide some verification steps for this bug? Isha Kandaswamy

          ajay.bhullar Ajay Bhullar added a comment - Can you provide some verification steps for this bug? Isha Kandaswamy
          arunkumar Arunkumar Senthilnathan (Inactive) added a comment - https://issues.couchbase.com/browse/CBSE-4687 - refer to this Ajay Bhullar
          ajay.bhullar Ajay Bhullar added a comment -

          verified in 5.5.0-2520 as per steps in the CBSE given

          select DATE_TRUNC_STR("2017-01-01","month")

          [
          {
          "$1": "2017-01-01"
          }
          ]

           

          select CLOCK_LOCAL() as local_time,
          STR_TO_TZ("2017-01-01 00:00:00", 'UTC') utc_datetime,
          DATE_TRUNC_STR("2017-01-01 00:00:00", "month") as test0,
          DATE_TRUNC_STR("2017-01-01 16:00:00", "month") as test1,
          DATE_TRUNC_STR("2017-01-01 15:59:59", "month") as test2,
          DATE_TRUNC_STR("2017-01-01 00:00:00Z", "month") as test3,
          DATE_TRUNC_STR("2017-01-01","month") as trunc_month,
          DATE_TRUNC_STR("2006-01-01","year") as trunc_year

          [
          {
          "local_time": "2018-04-17T15:53:55.516-07:00",
          "test0": "2017-01-01 00:00:00",
          "test1": "2017-01-01 00:00:00",
          "test2": "2017-01-01 00:00:00",
          "test3": null,
          "trunc_month": "2017-01-01",
          "trunc_year": "2006-01-01",
          "utc_datetime": "2017-01-01 08:00:00"
          }
          ]

          ajay.bhullar Ajay Bhullar added a comment - verified in 5.5.0-2520 as per steps in the CBSE given select DATE_TRUNC_STR("2017-01-01","month") [ { "$1": "2017-01-01" } ]   select CLOCK_LOCAL() as local_time, STR_TO_TZ("2017-01-01 00:00:00", 'UTC') utc_datetime, DATE_TRUNC_STR("2017-01-01 00:00:00", "month") as test0, DATE_TRUNC_STR("2017-01-01 16:00:00", "month") as test1, DATE_TRUNC_STR("2017-01-01 15:59:59", "month") as test2, DATE_TRUNC_STR("2017-01-01 00:00:00Z", "month") as test3, DATE_TRUNC_STR("2017-01-01","month") as trunc_month, DATE_TRUNC_STR("2006-01-01","year") as trunc_year [ { "local_time": "2018-04-17T15:53:55.516-07:00", "test0": "2017-01-01 00:00:00", "test1": "2017-01-01 00:00:00", "test2": "2017-01-01 00:00:00", "test3": null, "trunc_month": "2017-01-01", "trunc_year": "2006-01-01", "utc_datetime": "2017-01-01 08:00:00" } ]

          People

            ajay.bhullar Ajay Bhullar
            isha Isha Kandaswamy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty