dbms: fixed error [#METR-14902].

This commit is contained in:
Alexey Milovidov 2015-02-03 20:39:24 +03:00
parent 97b0966ce2
commit 60df70053d

View File

@ -405,8 +405,13 @@ public:
{
/// Размер - в количестве засечек.
if (!size)
{
if (columns.empty())
throw Exception("No columns in part " + name, ErrorCodes::NO_FILE_IN_DATA_PART);
size = Poco::File(storage.full_path + name + "/" + escapeForFileName(columns.front().name) + ".mrk")
.getSize() / MERGE_TREE_MARK_SIZE;
}
size_t key_size = storage.sort_descr.size();
index.resize(key_size * size);
@ -456,6 +461,9 @@ public:
columns.push_back(column);
}
if (columns.empty())
throw Exception("No columns in part " + name, ErrorCodes::NO_FILE_IN_DATA_PART);
{
WriteBufferFromFile out(path + ".tmp", 4096);
columns.writeText(out);