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

Values < 2^63 not entirely precise w.r.t Query Service UI

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.6.4
    • 7.6.2, 7.6.1
    • UI
    • Untriaged
    • Ubuntu 64-bit
    • 0
    • Unknown

    Description

      Initially reported in https://supportal.couchbase.com/zendesk/ticket/61356, a customer observed that when querying one of their documents which had a large numerical value (9393939393939393), the result of which was instead 9393939393939392.

      Issue is discussed in this Slack thread. Summary is that we believe this to be a UI issue, as everything works as expected ASIDE from the Query Workbench output.

      Via the Data / Query Service UI, I then performed a quick reproduction of this. In the `travel-sample` sample set of data, with respect to the airline collection:

      • I firstly clicked the "Add Document" button and gave it the Document ID testDocID.
      • The contents of this document were as follows:

       

      {
         "user_id": "001",
         "name": "Bill",
         "proposalNr": 9393939393939393
       
      }

      I then executed the following query in Query Workbench:

       

      SELECT * FROM airline a
      WHERE a.user_id = “001”; 

      The results of which were as follows:

       

       

      [
        {
          "a": {
            "user_id": "001",
            "name": "Bill",
            "proposalNr": 9393939393939392
          }
        }
      ] 

      As you can see, the value is 1 lower than it should be, which isn't as precise as expected.

       

       

      Donald Haggart then reproduced it in CBQ and observed expected precision:

       

      cbq> upsert into default values("t0",{"user":"001","test":9393939393939393});
      {
          "requestID": "b6d16329-0f70-4f81-bd19-1fb252890516",
          "signature": null,
          "results": [
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "1.408458ms",
              "executionTime": "1.267135ms",
              "resultCount": 0,
              "resultSize": 0,
              "serviceLoad": 3,
              "mutationCount": 1
          }
      }
      cbq> select * from default where user = "001";
      {
          "requestID": "9b8d4654-b139-4f2c-a598-06871e5adbc4",
          "signature": {
              "*": "*"
          },
          "results": [
          {
              "default": {
                  "test": 9393939393939393,
                  "user": "001"
              }
          }
          ], 

       

       

      I also tried the same query in the Analytics Service and also observed the expected precision:

       

      SELECT * FROM airline a
      WHERE a.user_id = “001”;	

      [{
         “a”: 
          {
            “user_id”: “001",
            “name”: “Bill”,
            “proposalNr”: 9393939393939393
          }
      }] 

      Using CBC CAT to read the document:

      # cbc cat testDocID -u couchbase -P couchbase -U couchbase://localhost/travel-sample --scope='inventory' --collection='airline'
      testDocID            CAS=0x17db103e2ef50000, Flags=0x2000006, Size=64, Datatype=0x01(JSON)
      {"user_id": "001","name": "Bill","proposalNr": 9393939393939393} 

       

       

      Attachments

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

        Activity

          People

            eben Eben Haber
            nam.duong Nam Duong
            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