Fix TSVRaw on long text

This commit is contained in:
hcz 2020-07-07 17:28:31 +08:00
parent e284bf83d0
commit 3683891ebc

View File

@ -33,13 +33,25 @@ public:
bool readField(IColumn & column, const DataTypePtr & type, bool) override bool readField(IColumn & column, const DataTypePtr & type, bool) override
{ {
char * pos = find_first_symbols<'\n', '\t'>(in.position(), in.buffer().end()); String tmp;
ReadBufferFromMemory cell(in.position(), pos - in.position());
while (!in.eof())
{
char * pos = find_first_symbols<'\n', '\t'>(in.position(), in.buffer().end());
tmp.append(in.position(), pos - in.position());
in.position() = pos;
if (pos == in.buffer().end())
in.next();
else
break;
}
ReadBufferFromString cell(tmp);
type->deserializeAsWholeText(column, cell, format_settings); type->deserializeAsWholeText(column, cell, format_settings);
in.position() = pos;
return true; return true;
} }
}; };