summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2009-01-30 04:57:44 +0000
committerJohn Christopher Anderson <jchris@apache.org>2009-01-30 04:57:44 +0000
commit02e15395d8f4fa43e135e48d321c89cc9622a1a8 (patch)
treea485852702fe295d5ebc5bcb0844a60b1225cd3e
parent38ba90e827fcc1105cb513c66f189eaea4436462 (diff)
all_docs view with descending=true works properly now. fix COUCHDB-109
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@739170 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--share/www/script/couch_tests.js5
-rw-r--r--src/couchdb/couch_btree.erl2
2 files changed, 4 insertions, 3 deletions
diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js
index 8aa9ad15..28a1b9f4 100644
--- a/share/www/script/couch_tests.js
+++ b/share/www/script/couch_tests.js
@@ -577,9 +577,8 @@ var tests = {
}
// Check _all_docs with descending=true again (now that there are many docs)
- // this fails, see COUCHDB-109
- // var desc = db.allDocs({descending:true});
- // T(desc.total_rows == desc.rows.length);
+ var desc = db.allDocs({descending:true});
+ T(desc.total_rows == desc.rows.length);
},
reduce: function(debug) {
diff --git a/src/couchdb/couch_btree.erl b/src/couchdb/couch_btree.erl
index f993a0a1..f2212aa0 100644
--- a/src/couchdb/couch_btree.erl
+++ b/src/couchdb/couch_btree.erl
@@ -558,6 +558,8 @@ adjust_dir(rev, List) ->
stream_node(Bt, Reds, PointerInfo, nil, Dir, Fun, Acc) ->
stream_node(Bt, Reds, PointerInfo, Dir, Fun, Acc);
+stream_node(Bt, Reds, PointerInfo, {}, rev, Fun, Acc) ->
+ stream_node(Bt, Reds, PointerInfo, rev, Fun, Acc);
stream_node(_Bt, _Reds, nil, _StartKey, _Dir, _Fun, Acc) ->
{ok, Acc};
stream_node(Bt, Reds, {Pointer, _Reds}, StartKey, Dir, Fun, Acc) ->