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

USE KEYS with empty string returns error EINVAL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 5.5.2, 6.0.0, 6.5.0
    • 5.5.0
    • query
    • None
    • Untriaged
    • Yes

    Description

      The following query returns error in 5.5.x by KV. This is regression.

      empty string is not valid META().id but this result in bigger issues with customers particularly with JOINs. The working queries start failing. We need to treat this is not qualified.

        SELECT * 
          FROM default USE KEYS "";
      "errors": [
              {
                  "code": 12008,
                  "msg": "Error performing bulk get operation  - cause: MCResponse status=EINVAL, opcode=GET, opaque=0, msg: "
              }
          ],
      
      

      Example :
      The following query use to work and return 1 row and now it gives error. As JOIN condition k2 is not satisfied it should not give a row, it is NOT ERROR.

      insert into default values("1",{"k1":"n007", "k2":"", "k3":"n0071", "k4":["n007","n006"]});
      insert into default values("1",{"k1":"n007", "k2":"n008", "k3":"n0071", "k4":["n007","n006"]});
      insert into default values("n008",{"name":"hello"});
       
      select * from default d  JOIN default d2 ON KEYS d.k2 ;
      
      

      https://forums.couchbase.com/t/n1ql-query-stops-working-in-5-5-1-but-was-working-in-5-0-1/18408

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty