couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r656589 - in /incubator/couchdb/trunk: share/www/script/couch_tests.js src/couchdb/couch_httpd.erl
Date Thu, 15 May 2008 11:44:38 GMT
Author: jan
Date: Thu May 15 04:44:37 2008
New Revision: 656589

URL: http://svn.apache.org/viewvc?rev=656589&view=rev
Log:
ignore descending=false option instead of throwing an error.
includes a test case

Modified:
    incubator/couchdb/trunk/share/www/script/couch_tests.js
    incubator/couchdb/trunk/src/couchdb/couch_httpd.erl

Modified: incubator/couchdb/trunk/share/www/script/couch_tests.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/share/www/script/couch_tests.js?rev=656589&r1=656588&r2=656589&view=diff
==============================================================================
--- incubator/couchdb/trunk/share/www/script/couch_tests.js [utf-8] (original)
+++ incubator/couchdb/trunk/share/www/script/couch_tests.js [utf-8] Thu May 15 04:44:37 2008
@@ -423,6 +423,9 @@
     restartServer();
     T(db.open(designDoc._id) == null);
     T(db.view("test/no_docs") == null);
+    
+    
+    
   },
 
   view_collation: function(debug) {
@@ -602,6 +605,19 @@
         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) {

Modified: incubator/couchdb/trunk/src/couchdb/couch_httpd.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/src/couchdb/couch_httpd.erl?rev=656589&r1=656588&r2=656589&view=diff
==============================================================================
--- incubator/couchdb/trunk/src/couchdb/couch_httpd.erl (original)
+++ incubator/couchdb/trunk/src/couchdb/couch_httpd.erl Thu May 15 04:44:37 2008
@@ -599,6 +599,9 @@
             _ ->
                 Args %already reversed
             end;
+        {"descending", "false"} ->
+          % ignore
+          Args;
         {"skip", Value} ->
             case (catch list_to_integer(Value)) of
             Count when is_integer(Count) ->



Mime
View raw message