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

MILLIS_TO_STR and STR_TO_MILLIS covert each other's output to incorrect value

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.6.0, 5.0.0
    • 4.6.0
    • query
    • None
    • Build: 4.6.0-3527
    • Untriaged
    • Unknown

    Description

      SELECT STR_TO_MILLIS("4993-12-23T03:26:51.084Z")
      

      gives:

      {
          "requestID": "be09206f-b896-4453-a0f6-b644cf75ce33",
          "clientContextID": "2223db1e-b1cb-4db8-a70e-0512d29c58d1",
          "signature": {
              "$1": "number"
          },
          "results": [
              {
                  "$1": 3193796042536
              }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "353.458µs",
              "executionTime": "316.846µs",
              "resultCount": 1,
              "resultSize": 43
          }
      }
      

      which is an incorrect result.
      It should be 67026261411000

      Date belonging to 3193796042536 millisecond is "2071-03-17T05:34:02.536Z"

      Also, when 67026261411000 milliseconds are converted to str.. They give incorrect results:

      SELECT MILLIS_TO_STR(67026261411000)
      

      Gives:

      {
          "requestID": "017a0b3a-1573-4de7-8998-30d85b4f88e5",
          "clientContextID": "8eee7c33-ff39-4843-9f98-c8a17e9cf71e",
          "signature": {
              "$1": "string"
          },
          "results": [
              {
                  "$1": "1677-09-21T00:12:43.145Z"
              }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "2.126091ms",
              "executionTime": "2.080686ms",
              "resultCount": 1,
              "resultSize": 56
          }
      }
      

      Attachments

        For Gerrit Dashboard: MB-21816
        # Subject Branch Project Status CR V

        Activity

          People

            prasanna.gholap Prasanna Gholap [X] (Inactive)
            prasanna.gholap Prasanna Gholap [X] (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