summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2014-11-21 16:35:21 -0500
committerRandolph Tan <randolph@10gen.com>2014-11-25 13:57:30 -0500
commit8cbb64b0bc8180079e2247143ae16f8d83bb3a00 (patch)
tree4adee4645ef2c91f80021b2869f2aa783043fadc /jstests
parent9b520aab07f8f098561061603efba1b0351d9a35 (diff)
downloadmongo-8cbb64b0bc8180079e2247143ae16f8d83bb3a00.tar.gz
SERVER-15318 copydb should not use exhaust flag when used against mongos
(cherry picked from commit 8deddb065c6124f31346d5f96efe8734da98d125) Conflicts: src/mongo/db/dbcommands_generic.cpp src/mongo/s/commands_public.cpp
Diffstat (limited to 'jstests')
-rw-r--r--jstests/sharding/copydb_from_mongos.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/jstests/sharding/copydb_from_mongos.js b/jstests/sharding/copydb_from_mongos.js
new file mode 100644
index 00000000000..c0aac23d552
--- /dev/null
+++ b/jstests/sharding/copydb_from_mongos.js
@@ -0,0 +1,16 @@
+var st = new ShardingTest({ shards: 2, other: { shardOptions: { verbose: 1 }}});
+
+var testDB = st.s.getDB('test');
+assert.writeOK(testDB.foo.insert({ a: 1 }));
+
+var res = testDB.adminCommand({ copydb: 1,
+ fromhost: st.s.host,
+ fromdb: 'test',
+ todb: 'test_copy' });
+assert.commandWorked(res);
+
+var copy = st.s.getDB('test_copy');
+assert.eq(1, copy.foo.count());
+assert.eq(1, copy.foo.findOne().a);
+
+st.stop();