dbms: additions to prev. revision [#METR-12857].

This commit is contained in:
Alexey Milovidov 2014-09-23 03:21:15 +04:00
parent 5cc3316485
commit a81b5d7df9

View File

@ -40,6 +40,9 @@ public:
if (Protocol::Server::Data == packet.type)
{
sample_block = packet.block;
if (!sample_block)
throw Exception("Logical error: empty block received as table structure", ErrorCodes::LOGICAL_ERROR);
}
else if (Protocol::Server::Exception == packet.type)
{
@ -54,6 +57,9 @@ public:
void write(const Block & block) override
{
if (!sample_block)
throw Exception("You must call IBlockOutputStream::writePrefix before IBlockOutputStream::write", ErrorCodes::LOGICAL_ERROR);
if (!blocksHaveEqualStructure(block, sample_block))
{
std::stringstream message;