CouchDB
  1. CouchDB
  2. COUCHDB-1372

"_stats" reduce producing errors on empty views

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.1
    • Fix Version/s: 1.2, 1.2.1, 1.3
    • Component/s: JavaScript View Server
    • Labels:
      None
    • Environment:

      windows, most likely effects all systems

    • Skill Level:
      Regular Contributors Level (Easy to Medium)

      Description

      have a database with any number of documents in it. create a map that outputs 0 things (no emits called). use reduce : "_stats". an error should occur.
      it's very common to have views be an empty set since maps act as filters in couchdb.

      when i use my own reduce functions i don't get errors, only with the standard couchdb functions.

      this wouldn't be a problem if i could use commonJS in my reduces.

        Activity

        Hide
        Robert Newson added a comment -

        I'm unable to reproduce this, could you include the error you received?

        Show
        Robert Newson added a comment - I'm unable to reproduce this, could you include the error you received?
        Hide
        Robert Newson added a comment -

        nvm, I see it now. The view still returns results ('

        {"rows":[]}

        ') but there's a function_clause in the log, doesn't appear fatal, but it is untidy.

        Show
        Robert Newson added a comment - nvm, I see it now. The view still returns results (' {"rows":[]} ') but there's a function_clause in the log, doesn't appear fatal, but it is untidy.
        Hide
        paul iannazzo added a comment -

        this causes my couchapps to crash.

        Show
        paul iannazzo added a comment - this causes my couchapps to crash.
        Hide
        Robert Newson added a comment -

        Added a clause for empty list for builtin_stats which fixes the function_clause.

        Show
        Robert Newson added a comment - Added a clause for empty list for builtin_stats which fixes the function_clause.

          People

          • Assignee:
            Robert Newson
            Reporter:
            paul iannazzo
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 24h
              24h
              Remaining:
              Remaining Estimate - 24h
              24h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development