dbms: fixed error [#CONV-7549].

This commit is contained in:
Alexey Milovidov 2013-05-31 17:34:30 +00:00
parent 37b679bb9a
commit 9848a42c82
3 changed files with 6 additions and 7 deletions

View File

@ -15,7 +15,5 @@ namespace DB
*/
void copyData(IBlockInputStream & from, IBlockOutputStream & to);
void copyData(IRowInputStream & from, IRowOutputStream & to);
void copyData(IBlockInputStream & from, IRowOutputStream & to);
void copyData(IRowInputStream & from, IBlockOutputStream & to, const Block & sample);
}

View File

@ -15,6 +15,11 @@ void copyData(IBlockInputStream & from, IBlockOutputStream & to)
while (Block block = from.read())
to.write(block);
/// Для вывода информации о количестве строк до LIMIT в некоторых форматах.
if (const IProfilingBlockInputStream * input = dynamic_cast<const IProfilingBlockInputStream *>(&from))
if (input->getInfo().hasAppliedLimit())
to.setRowsBeforeLimit(input->getInfo().getRowsBeforeLimit());
from.readSuffix();
to.writeSuffix();
}

View File

@ -581,11 +581,7 @@ BlockInputStreamPtr InterpreterSelectQuery::executeAndFormat(WriteBuffer & buf)
BlockInputStreamPtr in = execute();
BlockOutputStreamPtr out = context.getFormatFactory().getOutput(format_name, buf, sample);
if (const IProfilingBlockInputStream * input = dynamic_cast<const IProfilingBlockInputStream *>(&*in))
if (input->getInfo().hasAppliedLimit())
out->setRowsBeforeLimit(input->getInfo().getRowsBeforeLimit());
copyData(*in, *out);
return in;