Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 26843 invoked from network); 9 Nov 2009 09:47:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Nov 2009 09:47:21 -0000 Received: (qmail 65765 invoked by uid 500); 9 Nov 2009 09:47:19 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 65682 invoked by uid 500); 9 Nov 2009 09:47:19 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 65672 invoked by uid 99); 9 Nov 2009 09:47:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Nov 2009 09:47:19 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of b.candler@pobox.com designates 64.74.157.62 as permitted sender) Received: from [64.74.157.62] (HELO sasl.smtp.pobox.com) (64.74.157.62) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Nov 2009 09:47:08 +0000 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 65ABE984B1; Mon, 9 Nov 2009 04:46:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=date:from:to :cc:subject:message-id:references:mime-version:content-type :in-reply-to; s=sasl; bh=kApVbPBtZ0aQkbEsxD0LAk9YYj0=; b=H3zzM2T mrYyBes6N9eMhZdWHIBavhAZVZ8k584YprDRgUjBzYd3Aw8lKyhuycZ81H4LtpIo ImvE6qH8sTjaCaCViWGopf3ewaSGbtQOIhGXmyIo2deVOgGVHFeXFg2it8VVW8PL u+uwao/kb5EHyWLTaoezGyNxMcS7TG3llevQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=date:from:to:cc :subject:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=sasl; b=Mr4YwlFbq1dHaICfqO4SZ8nnlmUImESw4 eBqFrTZebSJy0M87/E9VkL/1uHNjBHkbg3dtx/H9CXp0kSqPso7nm9yeOqe/evD3 YVGBgW2b++0iB2omnhOWvYJLH+TlYKCci0OszX8BNTqNp9xybwNVZGyPCCOcWrhj Y8/jeudl10= Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 570A8984B0; Mon, 9 Nov 2009 04:46:44 -0500 (EST) Received: from mappit (unknown [80.45.95.114]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id C34A9984AF; Mon, 9 Nov 2009 04:46:42 -0500 (EST) Received: from brian by mappit with local (Exim 4.69) (envelope-from ) id 1N7Qpc-0002F9-2a; Mon, 09 Nov 2009 09:46:40 +0000 Date: Mon, 9 Nov 2009 09:46:40 +0000 From: Brian Candler To: Roger Binns Cc: user@couchdb.apache.org Subject: Re: Silent corruption of large numbers Message-ID: <20091109094640.GA8456@uk.tiscali.com> Mail-Followup-To: Roger Binns , user@couchdb.apache.org References: <4AF622D5.9070708@rogerbinns.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AF622D5.9070708@rogerbinns.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Pobox-Relay-ID: CA3418EA-CD14-11DE-8AB1-D595BBB5EC2E-28021239!a-pb-sasl-sd.pobox.com X-Virus-Checked: Checked by ClamAV on apache.org On Sat, Nov 07, 2009 at 05:45:57PM -0800, Roger Binns wrote: > As Adam pointed out, the problem is indeed Javascript. Accessing the > document directly does give the right answer. ... > I don't know what the right solution to this is. One option: store the values as strings. If there is an upper bound then you can pad them out so they still sort properly. For example, your 64-bit quantities could be stored as a string of 16 hex digits, left-padded with zeros. Another option: use the Erlang view server, and get a big view-building speed boost for free too. But in that case you must not expose your _design docs or _temp_view to untrusted clients, since the Erlang view server is not sandboxed and allows them to run arbitrary code. Regards, Brian.