mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
fix for csv import where last field has " SERVER-682
This commit is contained in:
parent
b32a47826e
commit
00ca5d90fe
@ -201,7 +201,7 @@ public:
|
||||
log(1) << "filesize: " << fileSize << endl;
|
||||
ProgressMeter pm( fileSize );
|
||||
const int BUF_SIZE = 1024 * 1024 * 4;
|
||||
boost::scoped_array<char> line(new char[BUF_SIZE]);
|
||||
boost::scoped_array<char> line(new char[BUF_SIZE+2]);
|
||||
while ( *in ){
|
||||
char * buf = line.get();
|
||||
in->getline( buf , BUF_SIZE );
|
||||
@ -214,6 +214,8 @@ public:
|
||||
if ( ! len )
|
||||
continue;
|
||||
|
||||
buf[len+1] = 0;
|
||||
|
||||
if ( in->rdstate() == ios_base::eofbit )
|
||||
break;
|
||||
assert( in->rdstate() == 0 );
|
||||
|
Loading…
Reference in New Issue
Block a user