Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-3843

Ensure that RAW only applies to queries with a single projection

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • None
    • library
    • 0

    Description

      Currently, we nievely add RAW to every COUNT function, which means queries like this fail because its a SQL++ syntax error:

      SELECT `c`.`EnrollmentDate` as `EnrollmentDate`, RAW COUNT(*) as `StudentCount`
      FROM `contoso`.`person`.`person` AS `c`
      WHERE `c`.`Discriminator` = "Student"
      GROUP BY `c`.`EnrollmentDate`
      

      We only want to add RAW for queries that look like this:

      SELECT COUNT(*)
      FROM `contoso`.`person`.`person` AS `c`
      WHERE `c`.`Discriminator` = "Student"
      

      Which results in:

      [
        {
          "$1": 8
        }
      ]
      

      If RAW is added to the query, then the output will look like:

      [
        8
      ]
      

      The alternative is to detect the nesting on deserialization and treat it as a scalar value.

      Attachments

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

        Activity

          People

            jmorris Jeff Morris
            jmorris Jeff Morris
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty