Return-Path: Delivered-To: apmail-incubator-couchdb-commits-archive@locus.apache.org Received: (qmail 5170 invoked from network); 21 Oct 2008 20:06:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Oct 2008 20:06:59 -0000 Received: (qmail 40900 invoked by uid 500); 21 Oct 2008 20:07:01 -0000 Delivered-To: apmail-incubator-couchdb-commits-archive@incubator.apache.org Received: (qmail 40867 invoked by uid 500); 21 Oct 2008 20:07:01 -0000 Mailing-List: contact couchdb-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-dev@incubator.apache.org Delivered-To: mailing list couchdb-commits@incubator.apache.org Received: (qmail 40858 invoked by uid 99); 21 Oct 2008 20:07:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Oct 2008 13:07:01 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Oct 2008 20:05:59 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7EA6E238899D; Tue, 21 Oct 2008 13:06:38 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r706744 - in /incubator/couchdb/trunk: share/www/script/couch_tests.js src/couchdb/couch_httpd_view.erl Date: Tue, 21 Oct 2008 20:06:38 -0000 To: couchdb-commits@incubator.apache.org From: jchris@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081021200638.7EA6E238899D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jchris Date: Tue Oct 21 13:06:37 2008 New Revision: 706744 URL: http://svn.apache.org/viewvc?rev=706744&view=rev Log: fix for COUCHDB-139 keys available when reduce=false Modified: incubator/couchdb/trunk/share/www/script/couch_tests.js incubator/couchdb/trunk/src/couchdb/couch_httpd_view.erl Modified: incubator/couchdb/trunk/share/www/script/couch_tests.js URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/share/www/script/couch_tests.js?rev=706744&r1=706743&r2=706744&view=diff ============================================================================== --- incubator/couchdb/trunk/share/www/script/couch_tests.js [utf-8] (original) +++ incubator/couchdb/trunk/share/www/script/couch_tests.js [utf-8] Tue Oct 21 13:06:37 2008 @@ -1311,6 +1311,10 @@ T(e.error == "query_parse_error"); } + // Test that a map & reduce containing func support keys when reduce=false + resp = db.view("test/summate", {reduce: false}, keys); + T(resp.rows.length == 5); + // Check that limiting by startkey_docid and endkey_docid get applied // as expected. var curr = db.view("test/multi_emit", {startkey_docid: 21, endkey_docid: 23}, [0, 2]).rows; Modified: incubator/couchdb/trunk/src/couchdb/couch_httpd_view.erl URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/src/couchdb/couch_httpd_view.erl?rev=706744&r1=706743&r2=706744&view=diff ============================================================================== --- incubator/couchdb/trunk/src/couchdb/couch_httpd_view.erl (original) +++ incubator/couchdb/trunk/src/couchdb/couch_httpd_view.erl Tue Oct 21 13:06:37 2008 @@ -346,9 +346,15 @@ exact -> QueryArgs; _ -> - Msg = lists:flatten(io_lib:format( - "Multi-key fetches for a reduce view must include group=true", [])), - throw({query_parse_error, Msg}) + #view_query_args{reduce=OptReduce} = QueryArgs, + case OptReduce of + true -> + Msg = lists:flatten(io_lib:format( + "Multi-key fetches for a reduce view must include group=true", [])), + throw({query_parse_error, Msg}); + _ -> + QueryArgs + end end end end.