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

[N1QL] N1QL scanner accepts escaped quoted strings as valid quoted strings. Should return an error.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.0.0
    • 4.5.1, 4.6.2, 5.0.0
    • query
    • Untriaged
    • Unknown

    Description

      {nformat}

      Index created:
      create index ix on default where y like "abc%\";

      Query issued:
      select x,y from default where x > 20 and y like "abc%\";

      Result:
      {
      "requestID": "fae254e1-b9c3-4517-b294-65af6cf1725c",
      "clientContextID": "a62e41b8-eff0-4343-825f-dd0d3a50fba7",
      "signature":

      { "x": "json", "y": "json" }

      ,
      "results": [

      { "x": 21, "y": "" }

      ],
      "status": "success",
      "metrics":

      { "elapsedTime": "20.231826ms", "executionTime": "20.193314ms", "resultCount": 1, "resultSize": 52 }

      }

      Document contents:

      { "x": 21, "y": "abctest" }

      select * from system:indexes shows index created as:

      {
      "indexes":

      { * "condition": "(`y` like \"\")",* "datastore_id": "http://127.0.0.1:8091", "id": "f2d2f0cba1115e6", "index_key": [ "`x`" ], "keyspace_id": "default", "name": "iy", "namespace_id": "default", "state": "online", "using": "gsi" }

      },

      *Note that the index created is showing condition as empty "condition": "(`y` like \"\")" *

      For same document, the below query gives correct results:
      select x,y from default where x > 20 and y like \"abc%"
      ;
      create index ix100 on default where y like "abc%";

      Are the backward slashes ignored in query?

       

      Attachments

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

        Activity

          People

            korrigan.clark Korrigan Clark (Inactive)
            Prerna.Manaktala Prerna Manaktala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty