Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 35384 invoked from network); 16 Apr 2010 17:32:18 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Apr 2010 17:32:18 -0000 Received: (qmail 58333 invoked by uid 500); 16 Apr 2010 17:32:18 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 58273 invoked by uid 500); 16 Apr 2010 17:32:18 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 58265 invoked by uid 99); 16 Apr 2010 17:32:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Apr 2010 17:32:18 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fdmanana@gmail.com designates 209.85.218.220 as permitted sender) Received: from [209.85.218.220] (HELO mail-bw0-f220.google.com) (209.85.218.220) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Apr 2010 17:32:11 +0000 Received: by bwz20 with SMTP id 20so2918952bwz.32 for ; Fri, 16 Apr 2010 10:31:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:received:message-id:subject:from:to:content-type; bh=hP5AU+e6tsaKcStSbwEXNnJBx/vnVAc0ItwbBfH1aZE=; b=WfHCpuGiOEQvsVEZukJ1fVCxsehYWm3YIgqPJn+rVtuJe8T27OhC5crgvMSXJHtfpq j3DdkHBfV6n5O1mWQjoeBYevkhnR1q5cdcvkuVvEUAMvqf+0If8KT3azbq4xo9DpdAv+ 6GeLeY1NvRtL2FL2UrVM8zQdUszFTecdvHRHM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=fpCZmnhuOaJYcxgqgV7GwBIPZItuA54NKFiI4NoTYIZQRoBSgkaSZmg4h+eqZrRtBo w7KVycqyRkXOR/2QekU4kQxMyoOF1tfY3xn5OsAusoSyLtVXAWpxuFf2GyjC2iuXn3y3 rw9jT4UYOTJeGvk8Hom41Fa9p7IV5PvG00cxk= MIME-Version: 1.0 Received: by 10.204.68.148 with HTTP; Fri, 16 Apr 2010 10:31:50 -0700 (PDT) Reply-To: fdmanana@gmail.com In-Reply-To: References: Date: Fri, 16 Apr 2010 18:31:50 +0100 Received: by 10.204.6.193 with SMTP id a1mr1982981bka.104.1271439110245; Fri, 16 Apr 2010 10:31:50 -0700 (PDT) Message-ID: Subject: Re: Filters in Erlang broken From: Filipe David Manana To: dev@couchdb.apache.org Content-Type: multipart/alternative; boundary=00151758f2ca85104a04845dfc79 X-Virus-Checked: Checked by ClamAV on apache.org --00151758f2ca85104a04845dfc79 Content-Type: text/plain; charset=UTF-8 You need a 3rd argument in your erlang filter function. This 3rd argument is the user context. I created a ticket at https://issues.apache.org/jira/browse/COUCHDB-740 with a patch attached to make that third parameter optional and add a test. I dunno if it should be made optional or stay as mandatory. On Fri, Apr 16, 2010 at 10:41 AM, Filipe David Manana wrote: > If nobody is already working on a fix, I can spend some time on it. > > > On Fri, Apr 16, 2010 at 4:49 AM, Paul Davis wrote: > >> Someone refactored couch_native_process.erl and forgot to update the >> design doc interaction thinger with random functions. >> >> In other words, it expects an argument like {_, Func} but gets >> ["filters", "foo"] IIRC. >> >> On Thu, Apr 15, 2010 at 8:18 PM, Ivan Bodunov >> wrote: >> > Hi, >> > >> > After I wrote my filter in JavaScript I decided to rewrite it in Erlang >> and >> > faced some problems. >> > Even the simplest possible filter written in Erlang causes crashes in >> > CouchDB. >> > >> > Filter is >> > "filters": { "foo": "fun({Doc},Req) -> true end." } >> > >> > Command to trigger the filter is >> > # curl -X GET http://localhost:5984/mytemp/_changes?filter=erl/foo >> > >> > Following link contains the crash report: >> > http://friendpaste.com/6eFpPOtTaaSRiXEvaUEmrZ >> > >> > CouchDB 0.11 on Mac. >> > >> > Ivan >> > >> > > > > -- > Filipe David Manana, > fdmanana@gmail.com > > "Reasonable men adapt themselves to the world. > Unreasonable men adapt the world to themselves. > That's why all progress depends on unreasonable men." > > -- Filipe David Manana, fdmanana@gmail.com "Reasonable men adapt themselves to the world. Unreasonable men adapt the world to themselves. That's why all progress depends on unreasonable men." --00151758f2ca85104a04845dfc79--