couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Monteiro (JIRA)" <j...@apache.org>
Subject [jira] Created: (COUCHDB-928) inclusive_end does not work as expected
Date Sun, 31 Oct 2010 01:23:20 GMT
inclusive_end does not work as expected
---------------------------------------

                 Key: COUCHDB-928
                 URL: https://issues.apache.org/jira/browse/COUCHDB-928
             Project: CouchDB
          Issue Type: Bug
    Affects Versions: 1.0.1
         Environment: x86 64bit Arch Linux 2.6.35
            Reporter: Marco Monteiro


I expected both of the following queries to return the result of the first one.
The difference betwen the two queries is the inclusive_end argument.

ruby-1.9.2-p0 > db.view("calculate/work_duration_by_project_id_and_start_time", :group_level=>2,
:startkey => ["0da7979149f2d71f1f5c2361c400c8f2", "2000"], :endkey => ["0da7979149f2d71f1f5c2361c400c8f2",
"2011"], :inclusive_end=>true)["rows"].each do |r| puts r end; nil
{"key"=>["0da7979149f2d71f1f5c2361c400c8f2", "2000-03-01 00:00:00"], "value"=>12340}
{"key"=>["0da7979149f2d71f1f5c2361c400c8f2", "2010-10-19 23:00:00"], "value"=>8400}
{"key"=>["0da7979149f2d71f1f5c2361c400c8f2", "2010-10-24 23:00:00"], "value"=>12900}
{"key"=>["0da7979149f2d71f1f5c2361c400c8f2", "2010-10-28 23:00:00"], "value"=>70975}
 => nil

ruby-1.9.2-p0 > db.view("calculate/work_duration_by_project_id_and_start_time", :group_level=>2,
:startkey => ["0da7979149f2d71f1f5c2361c400c8f2", "2000"], :endkey => ["0da7979149f2d71f1f5c2361c400c8f2",
"2011"], :inclusive_end=>false)["rows"].each do |r| puts r end; nil
{"key"=>["0da7979149f2d71f1f5c2361c400c8f2", "2000-03-01 00:00:00"], "value"=>12340}
{"key"=>["0da7979149f2d71f1f5c2361c400c8f2", "2010-10-19 23:00:00"], "value"=>8400}
{"key"=>["0da7979149f2d71f1f5c2361c400c8f2", "2010-10-24 23:00:00"], "value"=>12900}
{"key"=>["0da7979149f2d71f1f5c2361c400c8f2", "2010-10-28 23:00:00"], "value"=>70975}
{"key"=>["0da7979149f2d71f1f5c2361c40c11d5", "2010-10-28 23:00:00"], "value"=>7275}
{"key"=>["0da7979149f2d71f1f5c2361c40c6920", "2010-10-28 23:00:00"], "value"=>16975}
{"key"=>["0da7979149f2d71f1f5c2361c40c73ee", "2010-10-28 23:00:00"], "value"=>24100}
{"key"=>["0da7979149f2d71f1f5c2361c40c7ddb", "2010-10-28 23:00:00"], "value"=>7275}
{"key"=>["5465fdb28f9aae885dba76e4860010d4", "2000-03-01 00:00:00"], "value"=>600}
{"key"=>["5465fdb28f9aae885dba76e4860010d4", "2010-10-27 23:00:00"], "value"=>7200}
{"key"=>["5465fdb28f9aae885dba76e486001d07", "2000-03-01 00:00:00"], "value"=>1420}
{"key"=>["5465fdb28f9aae885dba76e4860020b4", "2000-03-01 00:00:00"], "value"=>1420}
{"key"=>["5465fdb28f9aae885dba76e4860021c8", "2000-03-01 00:00:00"], "value"=>600}
 => nil

All other agruments being equal, I expect a query with inclusive_end set to true to never
return less rows than one with inclusive_end set to false.
Am I missing something?

I have checked the request made by the CouchRest library (this could be a CouchRest bug),
and the request url is as expected.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message