dbms: development.

This commit is contained in:
Alexey Milovidov 2010-06-07 17:50:50 +00:00
parent f409cf1540
commit 1677287005
2 changed files with 6 additions and 5 deletions

View File

@ -77,13 +77,13 @@ void DataTypeString::deserializeBinary(IColumn & column, ReadBuffer & istr, size
UInt64 size; UInt64 size;
readVarUInt(size, istr); readVarUInt(size, istr);
offset += size; offset += size + 1;
offsets.push_back(offset); offsets.push_back(offset);
if (data.size() < offset) if (data.size() < offset)
data.resize(offset); data.resize(offset);
istr.readStrict(reinterpret_cast<char*>(&data[offset - size]), sizeof(ColumnUInt8::value_type) * size); istr.readStrict(reinterpret_cast<char*>(&data[offset - size - 1]), sizeof(ColumnUInt8::value_type) * size);
data[offset - 1] = 0; data[offset - 1] = 0;
} }
} }

View File

@ -124,13 +124,14 @@ int main(int argc, char ** argv)
/// читаем из неё /// читаем из неё
if (argc == 2 && 0 == strcmp(argv[1], "read")) if (argc == 2 && 0 == strcmp(argv[1], "read"))
{ {
/* DB::ColumnNames column_names; /*
DB::ColumnNames column_names;
boost::assign::push_back(column_names) boost::assign::push_back(column_names)
("SearchPhrase"); ("UniqID");
SharedPtr<DB::DataTypes> data_types = new DB::DataTypes; SharedPtr<DB::DataTypes> data_types = new DB::DataTypes;
boost::assign::push_back(*data_types) boost::assign::push_back(*data_types)
(new DB::DataTypeString); (new DB::DataTypeUInt64);
*/ */
DB::WriteBufferFromOStream out_buf(std::cout); DB::WriteBufferFromOStream out_buf(std::cout);