summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2008-05-15 11:44:37 +0000
committerJan Lehnardt <jan@apache.org>2008-05-15 11:44:37 +0000
commit41eeac05bff1b0a8b05f1110270c0beecd62991a (patch)
tree44c3df897d2f4e52d087e04236d1d2e7fab5f6b4
parent0816508c89c1d4fc851c1824cf8c78fe2519be67 (diff)
ignore descending=false option instead of throwing an error.
includes a test case git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@656589 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--share/www/script/couch_tests.js16
-rw-r--r--src/couchdb/couch_httpd.erl3
2 files changed, 19 insertions, 0 deletions
diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js
index cf1a4865..5f9cb5ae 100644
--- a/share/www/script/couch_tests.js
+++ b/share/www/script/couch_tests.js
@@ -423,6 +423,9 @@ var tests = {
restartServer();
T(db.open(designDoc._id) == null);
T(db.view("test/no_docs") == null);
+
+
+
},
view_collation: function(debug) {
@@ -602,6 +605,19 @@ var tests = {
T(queryResults.rows[j].key == i + 9 - j);
}
}
+
+ // ignore decending=false. CouchDB should just ignore that.
+ for (i = 0; i < docs.length; i += 10) {
+ var queryResults = db.query(queryFun, {startkey:i, startkey_docid:i,
+ descending:false, count:10});
+ T(queryResults.rows.length == 10)
+ T(queryResults.total_rows == docs.length)
+ T(queryResults.offset == i)
+ var j;
+ for (j = 0; j < 10;j++) {
+ T(queryResults.rows[j].key == i + j);
+ }
+ }
},
view_sandboxing: function(debug) {
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 52aa1507..11a380e9 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -599,6 +599,9 @@ parse_view_query(Req) ->
_ ->
Args %already reversed
end;
+ {"descending", "false"} ->
+ % ignore
+ Args;
{"skip", Value} ->
case (catch list_to_integer(Value)) of
Count when is_integer(Count) ->