You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by bi...@apache.org on 2011/11/28 13:36:33 UTC
[3/3] git commit: Failing test for duplicates in bulk docs
Failing test for duplicates in bulk docs
If a duplicate or worse yet, two different docs with the same id is
contained in a bullk docs save, both are returned as in conflict but
one is actually saved, usually the second one.
jira-911
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/f6cdf8a5
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/f6cdf8a5
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/f6cdf8a5
Branch: refs/heads/1.2.x
Commit: f6cdf8a5578229d0513fd928706a328178e4750d
Parents: 481b961
Author: Bob Dionne <bi...@apache.org>
Authored: Tue Oct 11 14:20:21 2011 -0400
Committer: Bob Dionne <bi...@apache.org>
Committed: Mon Nov 28 07:18:32 2011 -0500
----------------------------------------------------------------------
share/www/script/test/bulk_docs.js | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/f6cdf8a5/share/www/script/test/bulk_docs.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/bulk_docs.js b/share/www/script/test/bulk_docs.js
index 802eca7..27a97c8 100644
--- a/share/www/script/test/bulk_docs.js
+++ b/share/www/script/test/bulk_docs.js
@@ -108,4 +108,17 @@ couchTests.bulk_docs = function(debug) {
result = JSON.parse(req.responseText);
T(result.error == "bad_request");
T(result.reason == "Missing JSON list of 'docs'");
+
+ // jira-911
+ db.deleteDb();
+ db.createDb();
+ docs = [];
+ docs.push({"_id":"0", "a" : 0});
+ docs.push({"_id":"1", "a" : 1});
+ docs.push({"_id":"1", "a" : 2});
+ docs.push({"_id":"3", "a" : 3});
+ results = db.bulkSave(docs);
+ T(results[1].id == "1");
+ T(results[1].error == undefined);
+ T(results[2].error == "conflict");
};