Permalink
Browse files

Fix mongoimport on jsonArrays. SERVER-3834

  • Loading branch information...
stbrody authored and erh committed Sep 27, 2011
1 parent 35a196a commit 0f605b5ab37adaa3caa6bfb2ff3526b8202c94dc
Showing with 28 additions and 1 deletion.
  1. +27 −0 jstests/tool/exportimport3.js
  2. +1 −1 tools/import.cpp
@@ -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
@@ -396,7 +396,7 @@ class Import : public Tool {
break;
}
len += bytesProcessed;
- line += len;
+ line += bytesProcessed;
}
else {
if (!parseRow(in, o, len)) {

0 comments on commit 0f605b5

Please sign in to comment.