dbms: development

This commit is contained in:
Alexey Milovidov 2010-06-04 18:38:56 +00:00
parent 6951a0b7c1
commit 9e053a93f3
2 changed files with 5 additions and 10 deletions

View File

@ -25,13 +25,13 @@ Row TabSeparatedRowInputStream::read()
for (size_t i = 0; i < size; ++i)
{
(*data_types)[i]->deserializeTextEscaped(res[i], istr);
if (i == 0 && istr.eof())
{
res.clear();
return res;
}
(*data_types)[i]->deserializeTextEscaped(res[i], istr);
/// пропускаем разделители
if (i + 1 == size)

View File

@ -29,8 +29,6 @@ void DataTypeString::deserializeBinary(Field & field, ReadBuffer & istr) const
{
UInt64 size;
readVarUInt(size, istr);
if (istr.eof())
return;
field = String("");
String & s = boost::get<String>(field);
s.resize(size);
@ -73,12 +71,12 @@ void DataTypeString::deserializeBinary(IColumn & column, ReadBuffer & istr, size
size_t offset = 0;
for (size_t i = 0; i < limit; ++i)
{
if (istr.eof())
break;
UInt64 size;
readVarUInt(size, istr);
if (istr.eof())
break;
offset += size;
offsets.push_back(offset);
@ -86,9 +84,6 @@ void DataTypeString::deserializeBinary(IColumn & column, ReadBuffer & istr, size
data.resize(offset);
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);
}
}