dbms: development [#CONV-2944].

This commit is contained in:
Alexey Milovidov 2012-05-28 19:57:44 +00:00
parent 680936cf2a
commit f4a8dad41c
2 changed files with 5 additions and 1 deletions

View File

@ -389,6 +389,9 @@ private:
? query.substr(0, parsed_insert_query.data - query.data())
: query;
if ((is_interactive && !parsed_insert_query.data) || (!is_interactive && std_in.eof()))
throw Exception("No data to insert", ErrorCodes::NO_DATA_TO_INSERT);
connection->sendQuery(query_without_data, query_id, QueryProcessingStage::Complete);
/// Получим структуру таблицы
@ -446,7 +449,7 @@ private:
ReadBuffer data_in(const_cast<char *>(parsed_insert_query->data), parsed_insert_query->end - parsed_insert_query->data, 0);
sendDataFrom(data_in, sample);
}
else if (!is_interactive)
else if (!is_interactive && !std_in.eof())
{
/// Отправляем данные из stdin.
sendDataFrom(std_in, sample);

View File

@ -153,6 +153,7 @@ void Connection::sendData(const Block & block)
writeVarUInt(Protocol::Client::Data, *out);
block_out->write(block);
maybe_compressed_out->next();
out->next();
}