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

Escaped backtick causes parsing failure

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.1.0
    • 6.6.3, 7.0.0, 7.1.0
    • query
    • None
    • CBS 7.0.0 & 7.1.0
    • Untriaged
    • Yes

    Description

      • Seen on a Sync Gateway test, which passes on CBS 6.6, but fails on 7.0.0 & 7.1.0
      • Test attempts to introduce syntax error.  Should return zero rows for user `user1`AND`, and not return error (could be any backtick, like `bruno``s-login`)
      • Error msg:

       

      parsing failure | {"statement":"SELECT meta(`sg_int_0_1643208795438309000`).xattrs._sync.access.`user1``AND` as `value` FROM `sg_int_0_1643208795438309000` USE INDEX (sg_access_x1) WHERE any op in object_pairs(meta(`sg_int_0_1643208795438309000`).xattrs._sync.access) satisfies op.name = $userName end;","client_context_id":"d8d6042d-59b9-4ec8-9f5f-1f32772a0d36","errors":[{"Code":3000,"Message":"syntax error: invalid escaped identifier - line 1, column 65, near 'xattrs._sync.access.', at: `user1``AND`"}],"http_status_code":400}

       

      • Also validated by:

       

      rpm -q -a | grep couch
      couchbase-server-6.5.0-4960.x86_64
      [root@localhost ~]# scb
       Connected to : http://127.0.0.1:8093/. Type Ctrl-D or \QUIT to exit.
       
       Path to history file for the shell : /root/.cbq_history
      cbq> select d.`user1``AND` as b from [{"user1`AND":123} ] AS d;
      {
          "requestID": "08ee4e81-8493-440d-81ac-75f795fc0b92",
          "signature": {
              "b": "json"
          },
          "results": [
          {
              "b": 123
          }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "1.040523ms",
              "executionTime": "935.489µs",
              "resultCount": 1,
              "resultSize": 24
          }
      }

      cbq> select d.`user1``AND` as b from [{"user1`AND":123} ] AS d;
      {
          "requestID": "165bc4d1-c745-4254-9e2b-7c6f6bf4d6cb",
          "errors": [
              {
                  "code": 3000,
                  "msg": "syntax error: invalid escaped identifier - line 1, column 10, near 'select d.', at: `user1``AND`"
              }
          ],
          "status": "fatal",
          "metrics": {
              "elapsedTime": "861.935µs",
              "executionTime": "689.284µs",
              "resultCount": 0,
              "resultSize": 0,
              "serviceLoad": 6,
              "errorCount": 1
          }
      }
      cbq> [root@localhost ~]# rpm -q -a | grep couchbase
      couchbase-server-7.1.0-2088.x86_64
       

       

       

       

      Attachments

        For Gerrit Dashboard: MB-50619
        # Subject Branch Project Status CR V

        Activity

          People

            pierre.regazzoni Pierre Regazzoni
            bruno.alves Bruno Alves
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty