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

unknown_error, badarg when map function doesn't emit anything with a reduce function present but view called with reduce=false

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.0
    • 2.0-beta
    • view-engine
    • Security Level: Public
    • None
    • Windows 7 64 bit

    Description

      • If a map function is in a case where it doesn't emit anything (conditional emit)
      • If a reduce function is present (but not any built-in _count, _sum or _stats)
        Calling the view with reduce=false returns: {"error":"unknown_error","reason":"badarg"}

        expected:

        {"total_rows":0,"rows":[]}

      Steps to reproduce:

      Create a view with map function:
      function (doc, meta) {
      }

      and reduce function:
      function (key, values, rereduce)

      { return 0; }

      Visit: http://localhost:8092/default/_design/dev_test/_view/empty?reduce=false&stale=false
      (local install, design doc name is 'test', view name is 'empty')

      Observe result:

      {"error":"unknown_error","reason":"badarg"}

      Attachments

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

        Activity

          People

            FilipeManana Filipe Manana (Inactive)
            Kheops Kheops
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty