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

[Backport - MB-24048] - long integers are truncated when used in TOSTRING()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.6.3
    • 4.5.1, 4.6.0, 4.6.2, 4.6.3, 5.0.0
    • query
    • None
    • Untriaged
    • No

    Description

      select 1492855384243896327 as a, tostring(1492855384243896327) as b;
      {
       "requestID": "063db6e4-18f7-4073-bd8d-befaebbd269c",
       "signature": {
       "a": "number",
       "b": "string"
       },
       "results": [
       {
       "a": 1492855384243896327,
       "b": "1492855384243896300"
       }
       ],
       "status": "success",
       "metrics": {
       "elapsedTime": "2.873075ms",
       "executionTime": "2.855611ms",
       "resultCount": 1,
       "resultSize": 88
       }

       

      SELECT b.*, META().cas AS cas FROM ... => cas value is ok (1492855384243896332)
      SELECT b.*, ENCODE_JSON(META().cas) AS cas FROM ... => same as above
      SELECT b.*, TOSTRING(META().cas) AS cas FROM ... => cas value is NOT OK (1492855384243896300)

      https://forums.couchbase.com/t/n1ql-returns-a-different-cas-than-the-driver-functions/9124/9

      https://github.com/couchbase/query/blob/master/expression/func_type_conv.go#L398

      If it is integer above place we should not convert to float64

      Attachments

        Issue Links

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

          Activity

            People

              ajay.bhullar Ajay Bhullar
              Sitaram.Vemulapalli Sitaram Vemulapalli
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty