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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta
    • Fix Version/s: 2.0
    • Component/s: view-engine
    • Security Level: Public
    • Labels:
      None
    • Environment:
      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"}
      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Show
        farshid Farshid Ghods (Inactive) added a comment - http://review.membase.org/#/c/22107/
        Hide
        farshid Farshid Ghods (Inactive) added a comment -

        willl be included in 1931+ builds

        Show
        farshid Farshid Ghods (Inactive) added a comment - willl be included in 1931+ builds
        Hide
        steve Steve Yen added a comment -

        farshid merged alread

        Show
        steve Steve Yen added a comment - farshid merged alread
        Hide
        thuan Thuan Nguyen added a comment -

        Integrated in github-couchdb-preview #530 (See http://qa.hq.northscale.net/job/github-couchdb-preview/530/)
        MB-7055 Start reduce context when getting row count (Revision 6885701df07dd26d359c40da9c6b6dd6142bf22d)

        Result = SUCCESS
        Farshid Ghods :
        Files :

        • src/couchdb/couch_view.erl
        • src/couch_set_view/src/couch_set_view.erl
        Show
        thuan Thuan Nguyen added a comment - Integrated in github-couchdb-preview #530 (See http://qa.hq.northscale.net/job/github-couchdb-preview/530/ ) MB-7055 Start reduce context when getting row count (Revision 6885701df07dd26d359c40da9c6b6dd6142bf22d) Result = SUCCESS Farshid Ghods : Files : src/couchdb/couch_view.erl src/couch_set_view/src/couch_set_view.erl
        Hide
        deepkaran.salooja Deepkaran Salooja added a comment -

        verified with build 1939.

        Show
        deepkaran.salooja Deepkaran Salooja added a comment - verified with build 1939.

          People

          • Assignee:
            FilipeManana Filipe Manana (Inactive)
            Reporter:
            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