mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 05:22:17 +00:00
dbms: development
This commit is contained in:
parent
6951a0b7c1
commit
9e053a93f3
@ -25,13 +25,13 @@ Row TabSeparatedRowInputStream::read()
|
|||||||
|
|
||||||
for (size_t i = 0; i < size; ++i)
|
for (size_t i = 0; i < size; ++i)
|
||||||
{
|
{
|
||||||
(*data_types)[i]->deserializeTextEscaped(res[i], istr);
|
|
||||||
|
|
||||||
if (i == 0 && istr.eof())
|
if (i == 0 && istr.eof())
|
||||||
{
|
{
|
||||||
res.clear();
|
res.clear();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(*data_types)[i]->deserializeTextEscaped(res[i], istr);
|
||||||
|
|
||||||
/// пропускаем разделители
|
/// пропускаем разделители
|
||||||
if (i + 1 == size)
|
if (i + 1 == size)
|
||||||
|
@ -29,8 +29,6 @@ void DataTypeString::deserializeBinary(Field & field, ReadBuffer & istr) const
|
|||||||
{
|
{
|
||||||
UInt64 size;
|
UInt64 size;
|
||||||
readVarUInt(size, istr);
|
readVarUInt(size, istr);
|
||||||
if (istr.eof())
|
|
||||||
return;
|
|
||||||
field = String("");
|
field = String("");
|
||||||
String & s = boost::get<String>(field);
|
String & s = boost::get<String>(field);
|
||||||
s.resize(size);
|
s.resize(size);
|
||||||
@ -73,12 +71,12 @@ void DataTypeString::deserializeBinary(IColumn & column, ReadBuffer & istr, size
|
|||||||
size_t offset = 0;
|
size_t offset = 0;
|
||||||
for (size_t i = 0; i < limit; ++i)
|
for (size_t i = 0; i < limit; ++i)
|
||||||
{
|
{
|
||||||
|
if (istr.eof())
|
||||||
|
break;
|
||||||
|
|
||||||
UInt64 size;
|
UInt64 size;
|
||||||
readVarUInt(size, istr);
|
readVarUInt(size, istr);
|
||||||
|
|
||||||
if (istr.eof())
|
|
||||||
break;
|
|
||||||
|
|
||||||
offset += size;
|
offset += size;
|
||||||
offsets.push_back(offset);
|
offsets.push_back(offset);
|
||||||
|
|
||||||
@ -86,9 +84,6 @@ void DataTypeString::deserializeBinary(IColumn & column, ReadBuffer & istr, size
|
|||||||
data.resize(offset);
|
data.resize(offset);
|
||||||
|
|
||||||
istr.read(reinterpret_cast<char*>(&data[offset - size]), sizeof(ColumnUInt8::value_type) * size);
|
istr.read(reinterpret_cast<char*>(&data[offset - size]), sizeof(ColumnUInt8::value_type) * size);
|
||||||
|
|
||||||
if (istr.eof())
|
|
||||||
throw Exception("Cannot read all data from ReadBuffer", ErrorCodes::CANNOT_READ_DATA_FROM_READ_BUFFER);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user