**Describe the bug**
`SELECT i FROM generateRandom('i Array(Int8)', 1048575, 10, 1048577) LIMIT 1048575`

Memory limit should be respected.
{
    if (destination_id)
    {
        auto destination = DatabaseCatalog::instance().getTable(destination_id, context);
        if (destination.get() == this)
            throw Exception("Destination table is myself. Read will cause infinite loop.", ErrorCodes::INFINITE_LOOP);
        return destination->getQueryProcessingStage(context, to_stage, query_ptr);
    }
    return QueryProcessingStage::FetchColumns;
}
Pipe StorageBuffer::read(
    const Names & column_names,
    const StorageMetadataPtr & metadata_snapshot,
    const SelectQueryInfo & query_info,
    const Context & context,
    QueryProcessingStage::Enum processed_stage,
    size_t max_block_size,
    unsigned num_streams)
{
    Pipe pipe_from_dst;
    if (destination_id)
    {
        auto destination = DatabaseCatalog::instance().getTable(destination_id, context);