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

Memory limit should be respected.
#include <IO/WriteHelpers.h>
#include <Poco/Util/AbstractConfiguration.h>
namespace DB
{
/** Allow to store structured log in system table.
  *
  * Logging is asynchronous. Data is put into queue from where it will be read by separate thread.
  * That thread inserts log into a table with no more than specified periodicity.
  */
/** Structure of log, template parameter.
  * Structure could change on server version update.
  * If on first write, existing table has different structure,
  *  then it get renamed (put aside) and new table is created.
  */
/* Example:
    struct LogElement
    {
        /// default constructor must be available
        /// fields
        static std::string name();
        static Block createBlock();
        void appendToBlock(MutableColumns & columns) const;
    };
    */
namespace ErrorCodes
{
    extern const int TIMEOUT_EXCEEDED;
}
#define DBMS_SYSTEM_LOG_QUEUE_SIZE 1048576
class QueryLog;