Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix mongoimport on jsonArrays. SERVER-3834

  • Loading branch information...
commit 0f605b5ab37adaa3caa6bfb2ff3526b8202c94dc 1 parent 35a196a
@stbrody stbrody authored erh committed
Showing with 28 additions and 1 deletion.
  1. +27 −0 jstests/tool/exportimport3.js
  2. +1 −1  tools/import.cpp
View
27 jstests/tool/exportimport3.js
@@ -0,0 +1,27 @@
+// exportimport3.js
+
+t = new ToolTest( "exportimport3" );
+
+c = t.startDB( "foo" );
+assert.eq( 0 , c.count() , "setup1" );
+c.save({a:1})
+c.save({a:2})
+c.save({a:3})
+c.save({a:4})
+c.save({a:5})
+
+assert.eq( 5 , c.count() , "setup2" );
+
+
+t.runTool( "export" , "--jsonArray" , "--out" , t.extFile , "-d" , t.baseName , "-c" , "foo" );
+
+c.drop();
+assert.eq( 0 , c.count() , "after drop" , "-d" , t.baseName , "-c" , "foo" );;
+
+t.runTool( "import" , "--jsonArray" , "--file" , t.extFile , "-d" , t.baseName , "-c" , "foo" );
+
+assert.soon( "c.findOne()" , "no data after sleep" );
+assert.eq( 5 , c.count() , "after restore 2" );
+
+
+t.stop();
View
2  tools/import.cpp
@@ -396,7 +396,7 @@ class Import : public Tool {
break;
}
len += bytesProcessed;
- line += len;
+ line += bytesProcessed;
}
else {
if (!parseRow(in, o, len)) {
Please sign in to comment.
Something went wrong with that request. Please try again.