Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-2030

_user endpoint pagination causes query error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 3.1.0
    • 3.0
    • SyncGateway
    • Security Level: Public
    • None
    • CBG Sprint 97
    • 2

    Description

      On Sync Gateway/3.0.0(541;46803d1),

      invoking server:4985/bucketname/_user/ gets the following error
       

      {  "error": "Internal Server Error",  
         "reason":"Internal error: parsing failure | {\"statement\":\"SELECT META(`bucketname`).id FROM `bucketname` USE INDEX(sg_syncDocs_x1) WHERE META(`bucketname`).id LIKE '\\\\\\\\_sync:%' AND (META(`ipc-20002-prod`).id LIKE '\\\\\\\\_sync:user:%' OR META(`ipc-20002-prod`).id LIKE '\\\\\\\\_sync:role:%') ORDER BY META(`bucketname`).id LIMIT 5000 AND META(`bucketname`).id \>= $startkey\",\"client_context_id\":\"9c00aeff-43eb-40e3-a130-4f53c4a79b3b\",\"errors\":[{\"Code\":3000,\"Message\":\"Ambiguous reference to field ipc-20002-prod.\"}]}" }
       
      

      The query
      SELECT META(`bucketname`).id
      FROM `bucketname` USE INDEX(sg_syncDocs_x1)
      WHERE META(`bucketname`).id LIKE '
      _sync:%'
      AND (META(`bucketname`).id LIKE '
      _sync:user:%'
      OR META(`bucketname`).id LIKE '
      _sync:role:%')
      ORDER BY META(`bucketname`).id
      LIMIT 5000
      AND META(`bucketname`).id >= $startkey
      is malformed (if last "AND" condition is properly moved within the WHERE clause, it works).

      Attachments

        Issue Links

          Activity

            People

              adamf Adam Fraser
              mazzini Giacomo Mazzini
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty