Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-466

running query with 'pretty=true' loses precision on very large numbers

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Major
    • None
    • 2.4.0-dp2
    • query
    • None

    Description

      Create a document with a very large number, e.g.:

      {
      "bignum": 12345678901234567890123456789,
      "bignum_str": "12345678901234567890123456789"
      }

      Put it in the default bucket. Run a query with pretty=false, and it comes back fine:

       curl "http://Administrator:bluehorse@127.0.0.1:9093/query/service?statement=select%20*%20from%20default&pretty=false"
      {
      "requestID": "ea376505-2e01-4b4c-b494-6d8a7ce786ba",
      "signature": {"*":"*"},
      "results": [
      {"default":{
      "bignum": 12345678901234567890123456789,
      "bignum_str": "12345678901234567890123456789"
      }}
      ],
      "status": "success",
      "metrics": {"elapsedTime": "23.35ms","executionTime": "23.314ms","resultCount": 1,"resultSize": 102}
      }

       

      But if you run the same query with pretty=true, precision is lost in the number:

      curl "http://Administrator:bluehorse@127.0.0.1:9093/query/service?statement=select%20*%20from%20default&pretty=true"
      {
          "requestID": "6c2aec5c-4e40-4a83-8b26-919b61e91c5d",
          "signature": {
              "*": "*"
          },
          "results": [
              {
                  "default": {
                      "bignum": 12345678901234568000000000000,
                      "bignum_str": "12345678901234567890123456789"
                  }
              }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "15.024ms",
              "executionTime": "14.993ms",
              "resultCount": 1,
              "resultSize": 169
          }
      }
      

      Attachments

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

        Activity

          People

            Ellis.Breen Ellis Breen
            eben Eben Haber
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty